Skip to content

Commit 6e398e5

Browse files
committed
Fixed wx.chromectrl crash during shutdown when no browser was created during session.
There is something wrong with the wx.chromectrl sample2.py example. CPU usage is 100% all the time on Linux. Added comment about this in the source.
1 parent 7098805 commit 6e398e5

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

cefpython/cef3/wx-subpackage/chromectrl.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,12 @@ def MessageLoopTimer(event):
4545
def DestroyMessageLoopTimer():
4646
global g_messageLoopTimer
4747
Debug("DestroyMessageLoopTimer")
48-
g_messageLoopTimer.Stop()
49-
g_messageLoopTimer = None
48+
if g_messageLoopTimer:
49+
g_messageLoopTimer.Stop()
50+
g_messageLoopTimer = None
51+
else:
52+
# There was no browser created during session.
53+
Debug("DestroyMessageLoopTimer: timer not started")
5054

5155
#-------------------------------------------------------------------------------
5256

cefpython/cef3/wx-subpackage/examples/sample2.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# Slightly more advanced sample illustrating the usage of CEFWindow class
22
# __author__ = "Greg Kacy <grkacy@gmail.com>"
33

4+
# --WARNING--
5+
# TODO: There is something wrong with this example. On Linux
6+
# CPU usage for the python process is 100% all the time.
7+
# The other examples sample1.py / sample2.py do not
8+
# show such behavior. It must have something to do
9+
# with the wx controls used in this example.
10+
411
import wx
512
import wx.lib.agw.flatnotebook as fnb
613
import cefpython3.wx.chromectrl as chrome

0 commit comments

Comments
 (0)