Amiga: try to guard against page info window being destroyed twice

This commit is contained in:
Chris Young 2020-05-25 13:04:29 +01:00
parent 5c02f9bd97
commit 53d07a8e46
1 changed files with 7 additions and 3 deletions

View File

@ -67,9 +67,13 @@ ami_pageinfo_destroy(struct ami_corewindow *ami_cw)
{
nserror res;
struct ami_pageinfo_window *pageinfo_win = (struct ami_pageinfo_window *)ami_cw;
res = page_info_destroy(pageinfo_win->pi);
if (res == NSERROR_OK) {
ami_corewindow_fini(&pageinfo_win->core); /* closes the window for us */
if(pageinfo_win->pi != NULL) {
res = page_info_destroy(pageinfo_win->pi);
if (res == NSERROR_OK) {
pageinfo_win->pi = NULL;
ami_corewindow_fini(&pageinfo_win->core); /* closes the window for us */
}
}
}