]> git.saurik.com Git - wxWidgets.git/commitdiff
Ensure that the dirdialog is destroyed after use
authorRobin Dunn <robin@alldunn.com>
Mon, 5 Jan 2004 19:54:39 +0000 (19:54 +0000)
committerRobin Dunn <robin@alldunn.com>
Mon, 5 Jan 2004 19:54:39 +0000 (19:54 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25069 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/wx/lib/filebrowsebutton.py

index 708e1edadadd04a2bbecafc72aad1951250927c1..9777d73861cb4f63dbbeee045fb0d7e792c95cf5 100644 (file)
@@ -338,19 +338,17 @@ class DirBrowseButton(FileBrowseButton):
                                   labelText, buttonText, toolTip,
                                   dialogTitle, startDirectory,
                                   changeCallback = changeCallback)
-        #
-        self._dirDialog = dialogClass(self,
-                                      message = dialogTitle,
-                                      defaultPath = startDirectory)
+        self.dialogClass = dialogClass
     #
+
     def OnBrowse(self, ev = None):
-        dialog = self._dirDialog
+        dialog = self.dialogClass(self,
+                                  message = self.dialogTitle,
+                                  defaultPath = self.startDirectory)
         if dialog.ShowModal() == wx.ID_OK:
             self.SetValue(dialog.GetPath())
+        dialog.Destroy()
     #
-    def __del__(self):
-        if self.__dict__.has_key('_dirDialog'):
-            self._dirDialog.Destroy()
 
 
 #----------------------------------------------------------------------