$OpenBSD: patch-pgadmin_frm_events_cpp,v 1.3 2016/07/15 14:43:40 pea Exp $
--- pgadmin/frm/events.cpp.orig	Thu Jan  7 04:47:32 2016
+++ pgadmin/frm/events.cpp	Sat Jul  2 17:19:34 2016
@@ -41,7 +41,7 @@
 
 // Mutex to protect the "currentObject" from race conditions.
 //
-static wxMutex s_currentObjectMutex;
+static wxMutex *currentObjectMutex = new wxMutex( wxMUTEX_RECURSIVE );
 
 // Event table
 BEGIN_EVENT_TABLE(frmMain, pgFrame)
@@ -424,9 +424,9 @@ void frmMain::execSelChange(wxTreeItemId item, bool cu
 	//
 	// Lock the assignment to prevent the race conditions between onSelRightClick and execSelChange.
 	//
-	s_currentObjectMutex.Lock();
+	currentObjectMutex->Lock();
 	currentObject = browser->GetObject(item);
-	s_currentObjectMutex.Unlock();
+	currentObjectMutex->Unlock();
 
 	// If we didn't get an object, then we may have a right click, or
 	// invalid click, so ignore.
@@ -747,9 +747,9 @@ void frmMain::OnSelRightClick(wxTreeEvent &event)
 
 		// Prevent changes to "currentObject" by "execSelchange" function by another
 		// thread. Will hold the lock until we have the actual object in hand.
-		s_currentObjectMutex.Lock();
+		currentObjectMutex->Lock();
 		currentObject = browser->GetObject(item);
-		s_currentObjectMutex.Unlock();
+		currentObjectMutex->Unlock();
 	}
 
 	if (currentObject)
