fixed crash on disabling lighting
authorspog <spog>
Mon, 20 Feb 2006 21:48:46 +0000 (21:48 +0000)
committerspog <spog>
Mon, 20 Feb 2006 21:48:46 +0000 (21:48 +0000)
git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@15 8a3a26a2-13c4-0310-b231-cf6edde360e5

CHANGES
libs/gtkutil/accelerator.cpp
libs/gtkutil/accelerator.h
plugins/shaders/shaders.cpp
radiant/camwindow.cpp
radiant/gtkmisc.cpp

diff --git a/CHANGES b/CHANGES
index 7165be6..77ca4e9 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,10 @@
 This is the changelog for developers, != changelog for the end user 
 that we distribute with the binaries. (see changelog)
 
+20/02/2006
+SPoG
+- Fixed crash when disabling lighting for a second time.
+
 19/02/2006
 SPoG
 - Fixed crash when loading invalid ASE models.
index a4fc057..6a63fdd 100644 (file)
@@ -528,7 +528,7 @@ GClosure* global_accel_group_find(Accelerator accelerator)
   return 0;
 }
 
-void command_connect_accelerator(const Accelerator& accelerator, const Callback& callback)
+void global_accel_group_connect(const Accelerator& accelerator, const Callback& callback)
 {
   if(accelerator.key != 0)
   {
@@ -536,7 +536,7 @@ void command_connect_accelerator(const Accelerator& accelerator, const Callback&
   }
 }
 
-void command_disconnect_accelerator(const Accelerator& accelerator, const Callback& callback)
+void global_accel_group_disconnect(const Accelerator& accelerator, const Callback& callback)
 {
   if(accelerator.key != 0)
   {
index b34a98c..e4bd5a8 100644 (file)
@@ -71,8 +71,8 @@ void global_accel_destroy();
 
 GClosure* global_accel_group_find(Accelerator accelerator);
 
-void command_connect_accelerator(const Accelerator& accelerator, const Callback& callback);
-void command_disconnect_accelerator(const Accelerator& accelerator, const Callback& callback);
+void global_accel_group_connect(const Accelerator& accelerator, const Callback& callback);
+void global_accel_group_disconnect(const Accelerator& accelerator, const Callback& callback);
 
 
 class Command
index 3bfa729..7732681 100644 (file)
@@ -1177,6 +1177,7 @@ public:
       {
         GlobalTexturesCache().release((*i).texture());
       }
+      m_layers.clear();
     }
   }
 
index 5d5bea9..057e6aa 100644 (file)
@@ -1930,6 +1930,7 @@ void Camera_registerPreferencesPage()
 
 typedef FreeCaller1<bool, CamWnd_Move_Discrete_Import> CamWndMoveDiscreteImportCaller;
 
+/// \brief Initialisation for things that have the same lifespan as this module.
 void CamWnd_Construct()
 {
   GlobalCommands_insert("CenterView", FreeCaller<GlobalCamera_ResetAngles>(), Accelerator(GDK_End));
index d588198..f317525 100644 (file)
@@ -54,27 +54,27 @@ void command_connect_accelerator(const char* name)
 {
   const Command& command = GlobalCommands_find(name);
   GlobalShortcuts_register(name);
-  command_connect_accelerator(command.m_accelerator, command.m_callback);
+  global_accel_group_connect(command.m_accelerator, command.m_callback);
 }
 
 void command_disconnect_accelerator(const char* name)
 {
   const Command& command = GlobalCommands_find(name);
-  command_disconnect_accelerator(command.m_accelerator, command.m_callback);
+  global_accel_group_disconnect(command.m_accelerator, command.m_callback);
 }
 
 void toggle_add_accelerator(const char* name)
 {
   const Toggle& toggle = GlobalToggles_find(name);
   GlobalShortcuts_register(name);
-  command_connect_accelerator(toggle.m_command.m_accelerator, toggle.m_command.m_callback);
+  global_accel_group_connect(toggle.m_command.m_accelerator, toggle.m_command.m_callback);
 }
 
 GtkCheckMenuItem* create_check_menu_item_with_mnemonic(GtkMenu* menu, const char* mnemonic, const char* commandName)
 {
   GlobalShortcuts_register(commandName);
   const Toggle& toggle = GlobalToggles_find(commandName);
-  command_connect_accelerator(toggle.m_command.m_accelerator, toggle.m_command.m_callback);
+  global_accel_group_connect(toggle.m_command.m_accelerator, toggle.m_command.m_callback);
   return create_check_menu_item_with_mnemonic(menu, mnemonic, toggle);
 }
 
@@ -82,7 +82,7 @@ GtkMenuItem* create_menu_item_with_mnemonic(GtkMenu* menu, const char *mnemonic,
 {
   GlobalShortcuts_register(commandName);
   const Command& command = GlobalCommands_find(commandName);
-  command_connect_accelerator(command.m_accelerator, command.m_callback);
+  global_accel_group_connect(command.m_accelerator, command.m_callback);
   return create_menu_item_with_mnemonic(menu, mnemonic, command);
 }