$OpenBSD: patch-admin_cc,v 1.1.1.1 2001/04/02 15:14:52 wilfried Exp $
--- admin.cc.orig	Wed Dec 27 13:45:03 2000
+++ admin.cc	Sat Feb 10 19:19:19 2001
@@ -35,7 +35,7 @@ Fl_Window *Admin;
 	}
 	void cb_Admin (void) {
 		Fl::remove_timeout(my_timeout_callback,this);
-		if (Admin) Admin->hide(); delete Admin; Fl::remove_timeout(my_timeout_callback,this);
+		if (Admin) Admin->hide(); delete Admin; Admin=0; Fl::remove_timeout(my_timeout_callback,this);
 	}
 	static void s_cb_Admin(Fl_Window*, void*s) {
 		Panel *p=(Panel *)s;
@@ -145,7 +145,7 @@ Fl_Window *Admin;
 	}
 public:
   void get_me_some_new_values() {
-		if (!connected) { Admin->hide(); delete Admin; return;}
+		if (!connected) { Admin->hide(); delete Admin; Admin=0; return;}
 		if (No_no_no_you_can_not_have_that_type_of_reentrancy) return;
 		No_no_no_you_can_not_have_that_type_of_reentrancy=1;
 		try {
@@ -194,10 +194,10 @@ public:
 			No_no_no_you_can_not_have_that_type_of_reentrancy=0; s_fl_message("");
 		} catch (BadQuery er){ // handle any connection or query errors that may come up
 			adm_ispis = 1; s_fl_alert("Error in querying status: %s ",er.error.c_str());
-			if (Admin) {Admin->hide(); delete Admin;}  return;
+			if (Admin) {Admin->hide(); delete Admin;Admin=0; }  return;
 		} catch (BadConversion er) {
 			adm_ispis = 1; s_fl_alert ("Error: Tried to make impossible conversion");
-			if (Admin) {Admin->hide(); delete Admin; } return;
+			if (Admin) {Admin->hide(); delete Admin; Admin=0; } return;
 		}	
 	}
 	~Panel (void) {
@@ -330,7 +330,7 @@ public:
 		this->get_me_some_new_values();		
 		Fl::add_timeout(options->update_timeout,my_timeout_callback,this);
 		w->show(); 	
-		while(w->visible()) Fl::wait();
+		while(Admin && w->visible()) Fl::wait();
   }
 	}
 };
