]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/watchbsp.cpp
Merge commit '173f350be76237a7dee9c00c389dff4e56b3da4c' into garux-merge
[xonotic/netradiant.git] / radiant / watchbsp.cpp
index 50e6456c42ae7ad29563e2339fddd989b4dfe05f..118d37f47ab950e98812c74b2b44599103d9e00f 100644 (file)
@@ -211,6 +211,7 @@ void BuildMonitor_Construct(){
 
 void BuildMonitor_Destroy(){
        delete g_pWatchBSP;
+       g_pWatchBSP = NULL;
 }
 
 CWatchBSP *GetWatchBSP(){
@@ -469,7 +470,7 @@ static xmlSAXHandler saxParser = {
 // ------------------------------------------------------------------------------------------------
 
 
-guint s_routine_id;
+guint s_routine_id = 0;
 static gint watchbsp_routine( gpointer data ){
        reinterpret_cast<CWatchBSP*>( data )->RoutineProcessing();
        return TRUE;
@@ -489,8 +490,9 @@ void CWatchBSP::Reset(){
                m_xmlInputBuffer = NULL;
        }
        m_eState = EIdle;
-       if ( s_routine_id ) {
+       if ( s_routine_id != 0 ) {
                g_source_remove( s_routine_id );
+               s_routine_id = 0;
        }
 }
 
@@ -774,11 +776,11 @@ void CWatchBSP::DoMonitoringLoop( GPtrArray *pCmd, const char *sBSPName ){
        if ( m_eState != EIdle ) {
                globalOutputStream() << "WatchBSP got a monitoring request while not idling...\n";
                // prompt the user, should we cancel the current process and go ahead?
-//             if ( ui::alert( MainFrame_getWindow(), "I am already monitoring a Build process.\nDo you want me to override and start a new compilation?",
-//                                                      "Build process monitoring", ui::alert_type::YESNO ) == ui::alert_response::YES ) {
+               if ( ui::alert( MainFrame_getWindow(), "I am already monitoring a Build process.\nDo you want me to override and start a new compilation?",
+                                                        "Build process monitoring", ui::alert_type::YESNO ) == ui::alert_response::YES ) {
                        // disconnect and set EIdle state
                        Reset();
-//             }
+               }
        }
        m_pCmd = str_ptr_array_clone( pCmd );
        m_iCurrentStep = 0;