ru.po from igor, intl tweaks, picon fixes for last chkin, snap motion event on btns
[goodguy/history.git] / cinelerra-5.1 / guicast / bcsynchronous.C
index 4459fa363051686b076228c832d08b51f4f67776..54f5eec2c5ca500e675ef58fb150845abaf9effc 100644 (file)
@@ -119,8 +119,8 @@ BC_Synchronous::~BC_Synchronous()
 {
        if( running() ) {
                quit();
-               join();
        }
+       join();
        commands.remove_all_objects();
        delete lock_sync;
        delete next_command;
@@ -460,6 +460,7 @@ void BC_Synchronous::delete_display_sync(BC_SynchronousCommand *command)
        Display *display = command->display;
        XLockDisplay(display);
        XUnlockDisplay(display);
+       glXMakeContextCurrent(display, None, None, 0);
        XCloseDisplay(display);
 #endif
 }
@@ -472,13 +473,12 @@ void BC_Synchronous::put_pbuffer(int w, int h,
        table_lock->lock("BC_Resources::release_textures");
        for(int i = 0; i < pbuffer_ids.total; i++) {
                PBufferID *ptr = pbuffer_ids.values[i];
-               if(ptr->w == w && ptr->h == h && ptr->glx_pbuffer == glx_pbuffer) {
+               if( ptr->w == w && ptr->h == h && ptr->glx_pbuffer == glx_pbuffer ) {
                        exists = 1;
                        break;
                }
        }
 
-
        if(!exists) {
                PBufferID *ptr = new PBufferID(current_window->get_id(),
                        glx_pbuffer, glx_context, w, h);
@@ -487,10 +487,7 @@ void BC_Synchronous::put_pbuffer(int w, int h,
        table_lock->unlock();
 }
 
-GLXPbuffer BC_Synchronous::get_pbuffer(int w,
-       int h,
-       int *window_id,
-       GLXContext *glx_context)
+GLXPbuffer BC_Synchronous::get_pbuffer(int w, int h, GLXContext *glx_context)
 {
        table_lock->lock("BC_Resources::release_textures");
        for(int i = 0; i < pbuffer_ids.total; i++) {
@@ -499,7 +496,6 @@ GLXPbuffer BC_Synchronous::get_pbuffer(int w,
                        ptr->window_id == current_window->get_id() ) {
                        GLXPbuffer result = ptr->glx_pbuffer;
                        *glx_context = ptr->glx_context;
-                       *window_id = ptr->window_id;
                        ptr->in_use = 1;
                        table_lock->unlock();
                        return result;
@@ -514,7 +510,7 @@ void BC_Synchronous::release_pbuffer(int window_id, GLXPbuffer pbuffer)
        table_lock->lock("BC_Resources::release_textures");
        for(int i = 0; i < pbuffer_ids.total; i++) {
                PBufferID *ptr = pbuffer_ids.values[i];
-               if(ptr->window_id == window_id) {
+               if( ptr->window_id == window_id ) {
                        ptr->in_use = 0;
                }
        }