diff options
author | sabetts <sabetts> | 2000-08-30 05:18:33 +0000 |
---|---|---|
committer | sabetts <sabetts> | 2000-08-30 05:18:33 +0000 |
commit | eb7821a6503b7781b18d083a76634d03a6231db5 (patch) | |
tree | be494d5f9b7d20ad843c0994726cd58fb1838fde | |
parent | a334f42803a72d2bcc2f64b7f734df8b5ece165e (diff) | |
download | ratpoison-eb7821a6503b7781b18d083a76634d03a6231db5.zip |
rp_current_window was being left a dangling pointer in some cases in
remove_from_window_list(). BAD!
-rw-r--r-- | list.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -78,7 +78,6 @@ find_window (Window w) return NULL; } -/* this function can rp_current_window a dangling pointer. */ void remove_from_window_list (rp_window *w) { @@ -88,6 +87,10 @@ remove_from_window_list (rp_window *w) if (w->prev != NULL) w->prev->next = w->next; if (w->next != NULL) w->next->prev = w->prev; + /* set rp_current_window to NULL, so a dangling pointer is not + left. */ + if (rp_current_window == w) rp_current_window = NULL; + free (w); #ifdef DEBUG printf ("Removed window from list.\n"); |