patch-pgadmin_frm_events_cpp 1.3 KB

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