summaryrefslogtreecommitdiff
path: root/src/winwidget.c
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2020-08-28 23:09:38 +0200
committerDaniel Friesel <derf@finalrewind.org>2020-08-28 23:09:38 +0200
commite43916d7d1409e4031d56ee1704456bef55eeb1d (patch)
tree839a5a27874f5cdd77104f4b3bb4da7a84aca788 /src/winwidget.c
parentbfea10205a9fd4cb02cd6c94d2d94baaefaed278 (diff)
Fix segfault when closing a window in multi-window reload mode
Issue: * start feh --multiwindow --reload 5 * close a window with "x" * wait up to 5 seconds * segfault The issue was caused by the closed window's reload timer still being active even after the winwidget was free'd.
Diffstat (limited to 'src/winwidget.c')
-rw-r--r--src/winwidget.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/winwidget.c b/src/winwidget.c
index 6ff90ed..bfd987d 100644
--- a/src/winwidget.c
+++ b/src/winwidget.c
@@ -29,6 +29,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "winwidget.h"
#include "options.h"
#include "events.h"
+#include "timers.h"
#ifdef HAVE_INOTIFY
#include <sys/inotify.h>
@@ -673,6 +674,9 @@ void winwidget_destroy(winwidget winwid)
#ifdef HAVE_INOTIFY
winwidget_inotify_remove(winwid);
#endif
+ if (opt.reload > 0 && opt.multiwindow) {
+ feh_remove_timer_by_data(winwid);
+ }
winwidget_destroy_xwin(winwid);
if (winwid->name)
free(winwid->name);