diff --git a/aegisub/dialog_detached_video.cpp b/aegisub/dialog_detached_video.cpp index 2425e1e5d..7e748fd1c 100644 --- a/aegisub/dialog_detached_video.cpp +++ b/aegisub/dialog_detached_video.cpp @@ -79,8 +79,6 @@ DialogDetachedVideo::DialogDetachedVideo(FrameMain *par) ///////////// // Destructor DialogDetachedVideo::~DialogDetachedVideo() { - parent->detachedVideo = NULL; - parent->SetDisplayMode(1,-1); } @@ -88,6 +86,7 @@ DialogDetachedVideo::~DialogDetachedVideo() { // Event table BEGIN_EVENT_TABLE(DialogDetachedVideo,wxDialog) EVT_KEY_DOWN(DialogDetachedVideo::OnKey) + EVT_CLOSE(DialogDetachedVideo::OnClose) END_EVENT_TABLE() @@ -98,3 +97,13 @@ void DialogDetachedVideo::OnKey(wxKeyEvent &event) { event.Skip(); GetParent()->AddPendingEvent(event); } + + +//////////////// +// Close window +void DialogDetachedVideo::OnClose(wxCloseEvent &event) { + FrameMain *par = parent; + Destroy(); + par->detachedVideo = NULL; + par->SetDisplayMode(1,-1); +} diff --git a/aegisub/dialog_detached_video.h b/aegisub/dialog_detached_video.h index 1dcaf2e2a..1629ffee6 100644 --- a/aegisub/dialog_detached_video.h +++ b/aegisub/dialog_detached_video.h @@ -54,6 +54,7 @@ private: FrameMain *parent; void OnKey(wxKeyEvent &event); + void OnClose(wxCloseEvent &event); public: DialogDetachedVideo(FrameMain *parent);