From 44e5aea7b50ab80ea2882bc89b0acf25f1b7730d Mon Sep 17 00:00:00 2001 From: Chris Young Date: Mon, 25 May 2020 13:46:26 +0100 Subject: Amiga: avoid use after free Use the scheduler to trigger page info close as that does not allow the same event to be in the queue multiple times --- frontends/amiga/pageinfo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'frontends/amiga') diff --git a/frontends/amiga/pageinfo.c b/frontends/amiga/pageinfo.c index d9802818a..79e3ac62a 100644 --- a/frontends/amiga/pageinfo.c +++ b/frontends/amiga/pageinfo.c @@ -99,9 +99,9 @@ static BOOL ami_pageinfo_event(struct ami_corewindow *ami_cw, ULONG result) { if((result & WMHI_CLASSMASK) == WMHI_INACTIVE) { - /* Window went inactive, so close it */ - ami_pageinfo_destroy(ami_cw); - return TRUE; + /* Window went inactive, so schedule to close it */ + ami_schedule(0, ami_pageinfo_close_cb, pageinfo_win); + /* NB: do not return TRUE here as we're still open for now */ } return FALSE; } -- cgit v1.2.3