diff options
author | Kai Huuhko <kai.huuhko@gmail.com> | 2015-04-15 12:02:34 +0300 |
---|---|---|
committer | Kai Huuhko <kai.huuhko@gmail.com> | 2015-04-15 12:02:34 +0300 |
commit | 219ba9cdd960838dd164aa383b2233e44af5337f (patch) | |
tree | b8de4be5c3d9a006f4bf48896e963870325ef8e1 | |
parent | 1d5ae5fbc9d06a7c3f2f2e299daa8d4f2a2ed1eb (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.pyx | 4 | ||||
-rw-r--r-- | efl/eo/efl.eo.pyx | 3 | ||||
-rw-r--r-- | efl/evas/efl.evas.pyx | 3 |
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 | ||
248 | from libc.stdint cimport uintptr_t | 248 | from libc.stdint cimport uintptr_t |
249 | import traceback | ||
250 | from efl.eo cimport Eo, PY_REFCOUNT | 249 | from efl.eo cimport Eo, PY_REFCOUNT |
251 | from efl.utils.conversions cimport _ctouni | 250 | from efl.utils.conversions cimport _ctouni |
252 | from cpython cimport Py_INCREF, Py_DECREF | 251 | from cpython cimport Py_INCREF, Py_DECREF |
253 | 252 | ||
253 | import traceback | ||
254 | import atexit | ||
254 | 255 | ||
255 | 256 | ||
256 | cdef Eina_Bool _ecore_task_cb(void *data) with gil: | 257 | cdef Eina_Bool _ecore_task_cb(void *data) with gil: |
@@ -342,6 +343,7 @@ include "efl.ecore_file_download.pxi" | |||
342 | include "efl.ecore_file_monitor.pxi" | 343 | include "efl.ecore_file_monitor.pxi" |
343 | 344 | ||
344 | init() | 345 | init() |
346 | atexit.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 | ||
58 | import atexit | ||
59 | |||
58 | ###################################################################### | 60 | ###################################################################### |
59 | 61 | ||
60 | def init(): | 62 | def init(): |
@@ -66,6 +68,7 @@ def shutdown(): | |||
66 | return eo_shutdown() | 68 | return eo_shutdown() |
67 | 69 | ||
68 | init() | 70 | init() |
71 | atexit.register(shutdown) | ||
69 | 72 | ||
70 | def event_global_freeze_count_get(): | 73 | def 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 | ||
966 | cdef int PY_EFL_EVAS_LOG_DOMAIN = add_logger(__name__).eina_log_domain | 966 | cdef int PY_EFL_EVAS_LOG_DOMAIN = add_logger(__name__).eina_log_domain |
967 | 967 | ||
968 | import atexit | ||
969 | |||
968 | 970 | ||
969 | # TODO doc | 971 | # TODO doc |
970 | EVAS_HINT_FILL = -1.0 | 972 | EVAS_HINT_FILL = -1.0 |
@@ -1189,3 +1191,4 @@ include "efl.evas_object_grid.pxi" | |||
1189 | 1191 | ||
1190 | 1192 | ||
1191 | init() | 1193 | init() |
1194 | atexit.register(shutdown) | ||