Skip to content

Commit d398a63

Browse files
committed
Updated the Kivy OSR example to import the cefpython module
as the very first (see Issue 73).
1 parent dfd94d1 commit d398a63

1 file changed

Lines changed: 16 additions & 12 deletions

File tree

  • cefpython/cef3/linux/binaries_64bit

cefpython/cef3/linux/binaries_64bit/kivy_.py

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,14 @@
66
# In this example kivy-lang is used to declare the layout which
77
# contains two buttons (back, forward) and the browser view.
88

9-
from kivy.app import App
10-
from kivy.uix.widget import Widget
11-
from kivy.graphics import Color, Rectangle, GraphicException
12-
from kivy.clock import Clock
13-
from kivy.graphics.texture import Texture
14-
from kivy.core.window import Window
15-
from kivy.lang import Builder
16-
from kivy.uix.boxlayout import BoxLayout
17-
from kivy.base import EventLoop
18-
19-
####CEF IMPORT ####
9+
# On Linux importing the cefpython module must be the very
10+
# first in your application. This is because CEF makes a global
11+
# tcmalloc hook for memory allocation/deallocation. See Issue 73
12+
# that is to provide CEF builds with tcmalloc hook disabled:
13+
# https://code.google.com/p/cefpython/issues/detail?id=73
2014
import ctypes, os, sys
21-
libcef_so = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'libcef.so')
15+
libcef_so = os.path.join(os.path.dirname(
16+
os.path.abspath(__file__)), 'libcef.so')
2217
if os.path.exists(libcef_so):
2318
# Import local module
2419
ctypes.CDLL(libcef_so, ctypes.RTLD_GLOBAL)
@@ -30,6 +25,15 @@
3025
# Import from package
3126
from cefpython3 import cefpython
3227

28+
from kivy.app import App
29+
from kivy.uix.widget import Widget
30+
from kivy.graphics import Color, Rectangle, GraphicException
31+
from kivy.clock import Clock
32+
from kivy.graphics.texture import Texture
33+
from kivy.core.window import Window
34+
from kivy.lang import Builder
35+
from kivy.uix.boxlayout import BoxLayout
36+
from kivy.base import EventLoop
3337

3438
####Kivy APP ####
3539
Builder.load_string("""

0 commit comments

Comments
 (0)