summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Huuhko <kai.huuhko@gmail.com>2015-04-15 12:02:34 +0300
committerKai Huuhko <kai.huuhko@gmail.com>2015-04-15 12:02:34 +0300
commit219ba9cdd960838dd164aa383b2233e44af5337f (patch)
treeb8de4be5c3d9a006f4bf48896e963870325ef8e1
parent1d5ae5fbc9d06a7c3f2f2e299daa8d4f2a2ed1eb (diff)
Use atexit to shutdown eo, evas and ecore modules
They already had a call to init in the module, thus there was a mismatch not obvious to users.
-rw-r--r--efl/ecore/efl.ecore.pyx4
-rw-r--r--efl/eo/efl.eo.pyx3
-rw-r--r--efl/evas/efl.evas.pyx3
3 files changed, 9 insertions, 1 deletions
diff --git a/efl/ecore/efl.ecore.pyx b/efl/ecore/efl.ecore.pyx
index 9e421a3..7bb1c3f 100644
--- a/efl/ecore/efl.ecore.pyx
+++ b/efl/ecore/efl.ecore.pyx
@@ -246,11 +246,12 @@ Classes
246""" 246"""
247 247
248from libc.stdint cimport uintptr_t 248from libc.stdint cimport uintptr_t
249import traceback
250from efl.eo cimport Eo, PY_REFCOUNT 249from efl.eo cimport Eo, PY_REFCOUNT
251from efl.utils.conversions cimport _ctouni 250from efl.utils.conversions cimport _ctouni
252from cpython cimport Py_INCREF, Py_DECREF 251from cpython cimport Py_INCREF, Py_DECREF
253 252
253import traceback
254import atexit
254 255
255 256
256cdef Eina_Bool _ecore_task_cb(void *data) with gil: 257cdef Eina_Bool _ecore_task_cb(void *data) with gil:
@@ -342,6 +343,7 @@ include "efl.ecore_file_download.pxi"
342include "efl.ecore_file_monitor.pxi" 343include "efl.ecore_file_monitor.pxi"
343 344
344init() 345init()
346atexit.register(shutdown)
345 347
346 348
347#--------------------------------------------------------------------------- 349#---------------------------------------------------------------------------
diff --git a/efl/eo/efl.eo.pyx b/efl/eo/efl.eo.pyx
index 43411a4..d8cdf70 100644
--- a/efl/eo/efl.eo.pyx
+++ b/efl/eo/efl.eo.pyx
@@ -55,6 +55,8 @@ cdef int PY_REFCOUNT(object o):
55 cdef PyObject *obj = <PyObject *>o 55 cdef PyObject *obj = <PyObject *>o
56 return obj.ob_refcnt 56 return obj.ob_refcnt
57 57
58import atexit
59
58###################################################################### 60######################################################################
59 61
60def init(): 62def init():
@@ -66,6 +68,7 @@ def shutdown():
66 return eo_shutdown() 68 return eo_shutdown()
67 69
68init() 70init()
71atexit.register(shutdown)
69 72
70def event_global_freeze_count_get(): 73def event_global_freeze_count_get():
71 cdef int fcount = 0 74 cdef int fcount = 0
diff --git a/efl/evas/efl.evas.pyx b/efl/evas/efl.evas.pyx
index 2433e28..46fe2db 100644
--- a/efl/evas/efl.evas.pyx
+++ b/efl/evas/efl.evas.pyx
@@ -965,6 +965,8 @@ from efl.utils.logger cimport add_logger
965 965
966cdef int PY_EFL_EVAS_LOG_DOMAIN = add_logger(__name__).eina_log_domain 966cdef int PY_EFL_EVAS_LOG_DOMAIN = add_logger(__name__).eina_log_domain
967 967
968import atexit
969
968 970
969# TODO doc 971# TODO doc
970EVAS_HINT_FILL = -1.0 972EVAS_HINT_FILL = -1.0
@@ -1189,3 +1191,4 @@ include "efl.evas_object_grid.pxi"
1189 1191
1190 1192
1191init() 1193init()
1194atexit.register(shutdown)