Commit 7b79a74d authored by Garrett Regier's avatar Garrett Regier

Don't run an idle Python garbage collection

Running it in an idle shouldn't be needed, this was originally
copied from gedit's old plugin engine. This also fixes a
weird crash under Windows.

https://bugzilla.gnome.org/show_bug.cgi?id=748075
parent 87e18684
......@@ -48,7 +48,6 @@ class Hooks(object):
sys.path.insert(0, PEAS_PYEXECDIR)
gettext.install(GETTEXT_PACKAGE, PEAS_LOCALEDIR)
self.__idle_gc = 0
self.__module_cache = {}
self.__extension_cache = {}
......@@ -146,30 +145,15 @@ class Hooks(object):
module_gtypes[gtype] = None
return None
def __run_gc(self):
gc.collect()
self.__idle_gc = 0
return False
def garbage_collect(self):
# We run the GC right now and we schedule
# a further collection in the main loop
gc.collect()
if self.__idle_gc == 0:
self.__idle_gc = GLib.idle_add(self.__run_gc)
GLib.source_set_name_by_id(self.__idle_gc, '[libpeas] run_gc')
def all_plugins_unloaded(self):
pass
def exit(self):
gc.collect()
if self.__idle_gc != 0:
GLib.source_remove(self.__idle_gc)
if os.getenv('PEAS_PYTHON_PROFILE') is not None:
import cProfile
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment