7231: recursion limit during navigation; added lock to prevent reentrant calls over and over to prevent overflowing stack
This commit is contained in:
parent
2633afc555
commit
3e17a1586a
@ -27,12 +27,14 @@ from gramps.gui.utils import edit_object
|
|||||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||||
_ = glocale.translation.gettext
|
_ = glocale.translation.gettext
|
||||||
from gi.repository import Gtk
|
from gi.repository import Gtk
|
||||||
|
import threading
|
||||||
|
|
||||||
class Backlinks(Gramplet):
|
class Backlinks(Gramplet):
|
||||||
"""
|
"""
|
||||||
Displays the back references for an object.
|
Displays the back references for an object.
|
||||||
"""
|
"""
|
||||||
def init(self):
|
def init(self):
|
||||||
|
self.lock = threading.Lock()
|
||||||
self.gui.WIDGET = self.build_gui()
|
self.gui.WIDGET = self.build_gui()
|
||||||
self.gui.get_container_widget().remove(self.gui.textview)
|
self.gui.get_container_widget().remove(self.gui.textview)
|
||||||
self.gui.get_container_widget().add(self.gui.WIDGET)
|
self.gui.get_container_widget().add(self.gui.WIDGET)
|
||||||
@ -54,11 +56,13 @@ class Backlinks(Gramplet):
|
|||||||
"""
|
"""
|
||||||
Display the back references for an object.
|
Display the back references for an object.
|
||||||
"""
|
"""
|
||||||
for classname, handle in \
|
if self.lock.acquire():
|
||||||
self.dbstate.db.find_backlink_handles(active_handle):
|
for classname, handle in \
|
||||||
name = navigation_label(self.dbstate.db, classname, handle)[0]
|
self.dbstate.db.find_backlink_handles(active_handle):
|
||||||
self.model.add((_(classname), name, handle, classname))
|
name = navigation_label(self.dbstate.db, classname, handle)[0]
|
||||||
self.set_has_data(self.model.count > 0)
|
self.model.add((_(classname), name, handle, classname))
|
||||||
|
self.set_has_data(self.model.count > 0)
|
||||||
|
self.lock.release()
|
||||||
|
|
||||||
def get_has_data(self, active_handle):
|
def get_has_data(self, active_handle):
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user