Skip to content

Commit

Permalink
Merge pull request #498 from Jafaral/fix-wclose
Browse files Browse the repository at this point in the history
runtime: fix null pointer deference on a window close
  • Loading branch information
Don-Ward authored Jan 5, 2025
2 parents 10dbbd3 + 6d50011 commit a4056ac
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/runtime/rxwin.ri
Original file line number Diff line number Diff line change
Expand Up @@ -831,19 +831,20 @@ int handle_misc(wdp wd, wbp w)
*/
struct descrip d;
int ret = 0;
if (w && (evwin == w->window->win)) ret = 1;
if (ws->inputmask & WindowClosureMask) {
MakeInt(WINDOWCLOSED, &d);
qevent(wb->window, &d, 0, 0, 0, 0);
if (w && (evwin == w->window->win))
ret = 1;
MakeInt(WINDOWCLOSED, &d);
qevent(ws, &d, 0, 0, 0, 0);
if (ws->inputmask & WindowClosureMask)
return 1;
}

SETCLOSED((wbp)wb);
wclose(wb);
MakeInt(WINDOWCLOSED, &d);
qevent(wb->window, &d, 0, 0, 0, 0);
BlkD(lastEventWin,File)->status &= ~(Fs_Write);
if (ret) return 1;
break;
if (ret)
return 1;
else
break;
}
case DestroyNotify:
if (!ISZOMBIE(wb)) return -1; /* error #141 */
Expand Down

0 comments on commit a4056ac

Please sign in to comment.