diff options
author | Kai Huuhko <kai.huuhko@gmail.com> | 2016-02-02 21:41:37 +0200 |
---|---|---|
committer | Kai Huuhko <kai.huuhko@gmail.com> | 2016-02-02 21:41:37 +0200 |
commit | 1189e17fe0cd159190ebb6ae9b7a7f3dc9caee0b (patch) | |
tree | 602393f900fda2cca10e5be9586f2f8240eb2bf5 /efl | |
parent | fc987411daab68c60aa66c6ad3574426e3578ed4 (diff) |
Elm.FileSelector: Fix ref leak
Diffstat (limited to 'efl')
-rw-r--r-- | efl/elementary/fileselector.pxi | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/efl/elementary/fileselector.pxi b/efl/elementary/fileselector.pxi index a861bfb..77ef2d7 100644 --- a/efl/elementary/fileselector.pxi +++ b/efl/elementary/fileselector.pxi | |||
@@ -34,6 +34,8 @@ cdef class Fileselector(LayoutClass): | |||
34 | 34 | ||
35 | """ | 35 | """ |
36 | 36 | ||
37 | cdef list _custom_filters | ||
38 | |||
37 | def __init__(self, evasObject parent, *args, **kwargs): | 39 | def __init__(self, evasObject parent, *args, **kwargs): |
38 | """Fileselector(...) | 40 | """Fileselector(...) |
39 | 41 | ||
@@ -45,6 +47,7 @@ cdef class Fileselector(LayoutClass): | |||
45 | """ | 47 | """ |
46 | self._set_obj(elm_fileselector_add(parent.obj)) | 48 | self._set_obj(elm_fileselector_add(parent.obj)) |
47 | self._set_properties_from_keyword_args(kwargs) | 49 | self._set_properties_from_keyword_args(kwargs) |
50 | self._custom_filters = list() | ||
48 | 51 | ||
49 | property is_save: | 52 | property is_save: |
50 | """Enable/disable the file name entry box where the user can type | 53 | """Enable/disable the file name entry box where the user can type |
@@ -351,9 +354,7 @@ cdef class Fileselector(LayoutClass): | |||
351 | 354 | ||
352 | """ | 355 | """ |
353 | cb_data = (func, data) | 356 | cb_data = (func, data) |
354 | # FIXME: This is now a ref leak. It should be stored somewhere and | 357 | self._custom_filters.append(cb_data) |
355 | # deleted in the remove method. | ||
356 | Py_INCREF(cb_data) | ||
357 | 358 | ||
358 | if isinstance(filter_name, unicode): filter_name = PyUnicode_AsUTF8String(filter_name) | 359 | if isinstance(filter_name, unicode): filter_name = PyUnicode_AsUTF8String(filter_name) |
359 | elm_fileselector_custom_filter_append(self.obj, | 360 | elm_fileselector_custom_filter_append(self.obj, |
@@ -373,6 +374,7 @@ cdef class Fileselector(LayoutClass): | |||
373 | .. versionadded:: 1.8 | 374 | .. versionadded:: 1.8 |
374 | 375 | ||
375 | """ | 376 | """ |
377 | del self._custom_filters[:] | ||
376 | elm_fileselector_filters_clear(self.obj) | 378 | elm_fileselector_filters_clear(self.obj) |
377 | 379 | ||
378 | property hidden_visible: | 380 | property hidden_visible: |