]> git.sesse.net Git - vlc/blobdiff - modules/gui/wxwindows/wxwindows.cpp
* modules/gui/wxwindows/*: don't forget to delete the timer.
[vlc] / modules / gui / wxwindows / wxwindows.cpp
index eb734cc61a71e8a923e9847bd2808d0b8ff36645..90c14023b5182a64ff7524f27e282103d4281954 100644 (file)
@@ -2,7 +2,7 @@
  * wxwindows.cpp : wxWindows plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: wxwindows.cpp,v 1.33 2003/10/04 14:59:38 gbazin Exp $
+ * $Id: wxwindows.cpp,v 1.34 2003/10/14 22:41:41 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -66,6 +66,7 @@ public:
     Instance( intf_thread_t *_p_intf );
 
     bool OnInit();
+    int  OnExit();
 
 private:
     intf_thread_t *p_intf;
@@ -272,9 +273,6 @@ bool Instance::OnInit()
         MainInterface->Show( TRUE );
 
         SetTopWindow( MainInterface );
-
-        /* Start timer */
-        new Timer( p_intf, MainInterface );
     }
 
     /* Creates the dialogs provider */
@@ -291,6 +289,19 @@ bool Instance::OnInit()
     return TRUE;
 }
 
+/*****************************************************************************
+ * Instance::OnExit: called when the interface execution stops
+ *****************************************************************************/
+int Instance::OnExit()
+{
+    if( p_intf->pf_show_dialog )
+    {
+         /* We need to manually clean up the dialogs class */
+         if( p_intf->p_sys->p_wxwindow ) delete p_intf->p_sys->p_wxwindow;
+    }
+    return 0;
+}
+
 static void ShowDialog( intf_thread_t *p_intf, int i_dialog_event, int i_arg,
                         intf_dialog_args_t *p_arg )
 {