<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -426,7 +426,9 @@ public:
 	//! set extended error
 	void Extended_Error(std::string sError){ msExtendedError = sError;};
 	
-	
+
+	//! Called by CTrack_Editor_Pane before destruction
+	void Abort_TrackEditor_Related_Timers();
 	
 	
 </diff>
      <filename>Products/Koblo_Studio/trunk/include/CKSApplication.h</filename>
    </modified>
    <modified>
      <diff>@@ -151,8 +151,7 @@ CKSApplication::~CKSApplication()
 		delete[] mpPlugInManager;
 	}
 
-	AbortProgressTasks(true);
-	NonModalDialogs_ZapList();
+	Abort_TrackEditor_Related_Timers();
 
 	AudioInput_IntermediateBuffer_Kill();
 } // destructor
@@ -165,6 +164,20 @@ void CKSApplication::Destroy()
 } // Destroy
 
 
+void CKSApplication::Abort_TrackEditor_Related_Timers()
+{
+	// Destroy timer for error dialog thread
+	if (mpTimer_NonModalDialog) {
+		mpTimer_NonModalDialog-&gt;Destroy();
+		mpTimer_NonModalDialog = NULL;
+	}
+	NonModalDialogs_ZapList();
+
+	// Stop any ongoing progress tasks (includes destroying timer)
+	AbortProgressTasks(true);
+} // Abort_TrackEditor_Related_Timers
+
+
 kspi::IGUI* CKSApplication::CreateGUI(tint32 iIndex)
 {
 	CBaseGUI* pGUI;</diff>
      <filename>Products/Koblo_Studio/trunk/source/CKSApplication.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -24,6 +24,10 @@ CTrack_Editor_Pane::CTrack_Editor_Pane(CBasePane* pPaneParent, CBaseGUI* pGUI)
 
 CTrack_Editor_Pane::~CTrack_Editor_Pane()
 {
+	// Make sure we don't get a crash from CKSApplication timers
+	// that try to do something with track-editor GUI
+	gpApplication-&gt;Abort_TrackEditor_Related_Timers();
+
 	if (mpMouseTrap) {
 		delete mpMouseTrap;
 		mpMouseTrap = NULL;</diff>
      <filename>Products/Koblo_Studio/trunk/source/Track_View/CTrack_Editor_Pane.cpp</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>58ec63d2ec50507acc7b0cb18ac4b637d5586f35</id>
    </parent>
  </parents>
  <author>
    <name>lsbohnstedt</name>
    <email>lsbohnstedt@koblo.com</email>
  </author>
  <url>http://github.com/koblo/koblo_software/commit/ec5007058276a53b3db4c556213e95dbafbe6e12</url>
  <id>ec5007058276a53b3db4c556213e95dbafbe6e12</id>
  <committed-date>2009-02-27T02:43:40-08:00</committed-date>
  <authored-date>2009-02-27T02:43:40-08:00</authored-date>
  <message>KS: Avoid crashing on close due to still-running timers</message>
  <tree>5be84be18e92b1a566dd7e2bbf2dbd79c532b105</tree>
  <committer>
    <name>lsbohnstedt</name>
    <email>lsbohnstedt@koblo.com</email>
  </committer>
</commit>
