Browse Source

fix shutdown error

David Rose 13 năm trước cách đây
mục cha
commit
b9da2363f1
1 tập tin đã thay đổi với 5 bổ sung4 xóa
  1. 5 4
      direct/src/wxwidgets/WxPandaWindow.py

+ 5 - 4
direct/src/wxwidgets/WxPandaWindow.py

@@ -62,10 +62,11 @@ class EmbeddedPandaWindow(wx.Window):
             self.win = None
 
     def onSize(self, event):
-        wp = WindowProperties()
-        wp.setOrigin(0, 0)
-        wp.setSize(*self.GetClientSize())
-        self.win.requestProperties(wp)
+        if self.win:
+            wp = WindowProperties()
+            wp.setOrigin(0, 0)
+            wp.setSize(*self.GetClientSize())
+            self.win.requestProperties(wp)
         event.Skip()
 
 if not hasattr(wxgl, 'GLCanvas'):