X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fguicast%2Fbcdialog.C;h=0a855f68c9ca2ed109af96be92ff962094072003;hb=ba9e9e32512994d5bccdd782bce844b2338992b7;hp=64960351f68e3e041bfe93655c96d8a8175866f8;hpb=17c1843cd537108ae6e852546a39f15ac5e33e40;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/guicast/bcdialog.C b/cinelerra-5.1/guicast/bcdialog.C index 64960351..0a855f68 100644 --- a/cinelerra-5.1/guicast/bcdialog.C +++ b/cinelerra-5.1/guicast/bcdialog.C @@ -34,6 +34,7 @@ BC_DialogThread::BC_DialogThread() gui = 0; startup_lock = new Condition(1, "BC_DialogThread::startup_lock"); window_lock = new Mutex("BC_DialogThread::window_lock"); + active_lock = new Mutex("BC_DialogThread::active_lock"); } BC_DialogThread::~BC_DialogThread() @@ -49,6 +50,7 @@ BC_DialogThread::~BC_DialogThread() delete startup_lock; delete window_lock; + delete active_lock; } void BC_DialogThread::lock_dialog(const char *location) @@ -93,6 +95,7 @@ void BC_DialogThread::start() void BC_DialogThread::run() { + active_lock->lock("BC_DialogThread::run"); gui = new_gui(); startup_lock->unlock(); int result = gui->run_window(); @@ -105,6 +108,7 @@ void BC_DialogThread::run() window_lock->unlock(); handle_close_event(result); + active_lock->unlock(); } BC_Window* BC_DialogThread::new_gui() @@ -139,6 +143,11 @@ void BC_DialogThread::close_window() join(); } - +void BC_DialogThread::join() +{ + if( !running() ) return; + active_lock->lock("BC_DialogThread::join"); + active_lock->unlock(); +}