Commit 2cea7a80 authored by sumpfralle's avatar sumpfralle

fixed improper cleanup function of OpenGLWindow plugin (caused a segfault)


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@1214 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent f769b18b
...@@ -41,7 +41,7 @@ class OpenGLViewModel(pycam.Plugins.PluginBase): ...@@ -41,7 +41,7 @@ class OpenGLViewModel(pycam.Plugins.PluginBase):
("model-changed","visual-item-updated"), ("model-changed","visual-item-updated"),
("model-list-changed","visual-item-updated")) ("model-list-changed","visual-item-updated"))
self.core.get("register_display_item")("show_model", "Show Model", 10) self.core.get("register_display_item")("show_model", "Show Model", 10)
self.core.get("register_color") ("color_model", "Model", 10) self.core.get("register_color")("color_model", "Model", 10)
self.core.register_chain("get_draw_dimension", self.get_draw_dimension) self.core.register_chain("get_draw_dimension", self.get_draw_dimension)
self.register_event_handlers(self._event_handlers) self.register_event_handlers(self._event_handlers)
self.core.emit_event("visual-item-updated") self.core.emit_event("visual-item-updated")
...@@ -53,6 +53,7 @@ class OpenGLViewModel(pycam.Plugins.PluginBase): ...@@ -53,6 +53,7 @@ class OpenGLViewModel(pycam.Plugins.PluginBase):
self.core.unregister_chain("get_draw_dimension", self.core.unregister_chain("get_draw_dimension",
self.get_draw_dimension) self.get_draw_dimension)
self.core.get("unregister_display_item")("show_model") self.core.get("unregister_display_item")("show_model")
self.core.get("unregister_color")("color_model")
self.core.emit_event("visual-item-updated") self.core.emit_event("visual-item-updated")
def _get_cache_key(self, model, *args, **kwargs): def _get_cache_key(self, model, *args, **kwargs):
......
...@@ -231,7 +231,6 @@ class OpenGLWindow(pycam.Plugins.PluginBase): ...@@ -231,7 +231,6 @@ class OpenGLWindow(pycam.Plugins.PluginBase):
toggle_3d.set_active(False) toggle_3d.set_active(False)
self.core.unregister_ui("view_menu", toggle_3d) self.core.unregister_ui("view_menu", toggle_3d)
self.unregister_gtk_accelerator("opengl", toggle_3d) self.unregister_gtk_accelerator("opengl", toggle_3d)
self.core.unregister_ui("view_menu", toggle_3d)
for name in ("color_background", "color_cutter", "color_material"): for name in ("color_background", "color_cutter", "color_material"):
self.core.get("unregister_color")(name) self.core.get("unregister_color")(name)
for name in ("show_drill", "show_directions"): for name in ("show_drill", "show_directions"):
...@@ -242,6 +241,15 @@ class OpenGLWindow(pycam.Plugins.PluginBase): ...@@ -242,6 +241,15 @@ class OpenGLWindow(pycam.Plugins.PluginBase):
# the area will be created during setup again # the area will be created during setup again
self.gui.get_object("OpenGLBox").remove(self.area) self.gui.get_object("OpenGLBox").remove(self.area)
self.area = None self.area = None
self.core.unregister_ui("preferences",
self.gui.get_object("DisplayItemsPrefTab"))
self.core.unregister_ui("preferences",
self.gui.get_object("OpenGLPrefTab"))
self.core.unregister_ui("opengl_window",
self.gui.get_object("ViewControls"))
self.core.unregister_ui("preferences",
self.gui.get_object("ColorPrefTab"))
self.core.unregister_ui_section("opengl_window")
self.clear_state_items() self.clear_state_items()
def update_view(self, widget=None, data=None): def update_view(self, widget=None, data=None):
......
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