Update of /cvsroot/audacity/audacity-src/src
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv23579

Modified Files:
        Menus.cpp 
Log Message:
Fixed crash during shutdown that was reported by Sami Liedes.

Index: Menus.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Menus.cpp,v
retrieving revision 1.473
retrieving revision 1.474
diff -u -d -r1.473 -r1.474
--- Menus.cpp   25 Apr 2009 23:06:56 -0000      1.473
+++ Menus.cpp   9 May 2009 18:01:59 -0000       1.474
@@ -1420,6 +1420,12 @@
 
 void AudacityProject::ModifyToolbarMenus()
 {
+   // Refreshes can occur during shutdown and the toolmanager may already
+   // be deleted, so protect against it.
+   if (!mToolManager) {
+      return;
+   }
+
    mCommandManager.Check(wxT("ShowControlTB"),
                         mToolManager->IsVisible(ControlBarID));
    mCommandManager.Check(wxT("ShowDeviceTB"),
@@ -1436,14 +1442,11 @@
                          mToolManager->IsVisible(ToolsBarID));
    mCommandManager.Check(wxT("ShowTranscriptionTB"),
                          mToolManager->IsVisible(TranscriptionBarID));
-   mCommandManager.Check(wxT("StickyLabels"), mStickyFlag);                    
     
-   bool active;
-   gPrefs->Read(wxT("/AudioIO/SoundActivatedRecord"),&active, false);
-   mCommandManager.Check(wxT("SoundActivation"), active);
-   gPrefs->Read(wxT("/AudioIO/Duplex"),&active, true);
-   mCommandManager.Check(wxT("Duplex"), active);
-   gPrefs->Read(wxT("/AudioIO/SWPlaythrough"),&active, false);
-   mCommandManager.Check(wxT("SWPlaythrough"), active);
+
+   // Now, go through each toolbar, and call EnableDisableButtons()
+   for (int i = 0; i < ToolBarCount; i++) {
+      mToolManager->GetToolBar(i)->EnableDisableButtons();
+   }
 }
 
 void AudacityProject::UpdateMenus()
@@ -1484,11 +1487,15 @@
 
    ModifyToolbarMenus();
 
-   // Now, go through each toolbar, and call EnableDisableButtons()
-   for( int i = 0; i < ToolBarCount; i++ )
-   {
-      mToolManager->GetToolBar( i )->EnableDisableButtons();
-   }
+   bool active;
+   gPrefs->Read(wxT("/AudioIO/SoundActivatedRecord"),&active, false);
+   mCommandManager.Check(wxT("SoundActivation"), active);
+   gPrefs->Read(wxT("/AudioIO/Duplex"),&active, true);
+   mCommandManager.Check(wxT("Duplex"), active);
+   gPrefs->Read(wxT("/AudioIO/SWPlaythrough"),&active, false);
+   mCommandManager.Check(wxT("SWPlaythrough"), active);
+
+   mCommandManager.Check(wxT("StickyLabels"), mStickyFlag);                    
     
 }
 
 //


------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to