diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2020-05-25 13:46:26 +0100 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2020-05-25 13:50:20 +0100 |
commit | 44e5aea7b50ab80ea2882bc89b0acf25f1b7730d (patch) | |
tree | 4ea271f6aec0e27ffe166af6b3c356ce764d63ba /frontends | |
parent | 8924f0c7f97103a27576ca1a09b7272da2af0c04 (diff) | |
download | netsurf-44e5aea7b50ab80ea2882bc89b0acf25f1b7730d.tar.gz netsurf-44e5aea7b50ab80ea2882bc89b0acf25f1b7730d.tar.bz2 |
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
Diffstat (limited to 'frontends')
-rw-r--r-- | frontends/amiga/pageinfo.c | 6 |
1 files changed, 3 insertions, 3 deletions
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; } |