Skip to content

Commit 00a9b1c

Browse files
committed
Fixed a crash in PyQt and PySide examples when closing main window (Issue 30).
1 parent 8859e75 commit 00a9b1c

3 files changed

Lines changed: 11 additions & 0 deletions

File tree

cefpython1/window_utils_win.pyx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Put EnforceWindowIcon() and EnforeWindowTitle() here.

cefpython1/windows_example/pyqt.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,9 @@ def stopTimer(self):
110110
app.exec_()
111111
app.stopTimer()
112112

113+
# Need to destroy QApplication() by assigning None, otherwise Shutdown() fails.
114+
# Unset main window also just to be safe.
115+
mainWindow = None
116+
app = None
117+
113118
cefpython.Shutdown()

cefpython1/windows_example/pyside.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,5 +127,10 @@ def stopTimer(self):
127127
mainWindow.show()
128128
app.exec_()
129129
app.stopTimer()
130+
131+
# Need to destroy QApplication() by assigning None, otherwise Shutdown() fails.
132+
# Unset main window also just to be safe.
133+
mainWindow = None
134+
app = None
130135

131136
cefpython.Shutdown()

0 commit comments

Comments
 (0)