1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 03:08:11 +00:00

Close the MsgBox when clicking the OK button.

This feels vaguely crashy. I haven't tested window/widget destruction
before so there's sure to be bugs.
This commit is contained in:
Andreas Kling 2018-10-14 01:23:01 +02:00
parent 3ebea05996
commit 959a1b0750
9 changed files with 65 additions and 9 deletions

View file

@ -28,6 +28,9 @@ void Object::event(Event& event)
switch (event.type()) {
case Event::Timer:
return timerEvent(static_cast<TimerEvent&>(event));
case Event::DeferredDestroy:
delete this;
break;
case Event::Invalid:
ASSERT_NOT_REACHED();
break;
@ -82,3 +85,8 @@ void Object::stopTimer()
m_timerID = 0;
}
void Object::deleteLater()
{
EventLoop::main().postEvent(this, make<DeferredDestroyEvent>());
}