VirtualBox

Changeset 39631 in vbox for trunk/src


Ignore:
Timestamp:
Dec 15, 2011 4:09:12 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
75426
Message:

crOpenGL: context & window destroy fixes

Location:
trunk/src/VBox/Additions/common/crOpenGL
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/crOpenGL/context.c

    r39602 r39631  
    346346static DECLCALLBACK(void) stubContextDtor(void*pvContext)
    347347{
     348    crHashtableLock(stub.windowTable);
    348349    crHashtableLock(stub.contextTable);
    349350    stubDestroyContextLocked((ContextInfo*)pvContext);
    350351    crHashtableUnlock(stub.contextTable);
     352    crHashtableUnlock(stub.windowTable);
    351353}
    352354#endif
     
    11811183    }
    11821184
     1185    /* the lock order is windowTable->contextTable (see wglMakeCurrent_prox, glXMakeCurrent)
     1186     * this is why we need to take a windowTable lock since we will later do stub.windowTable access & locking */
     1187    crHashtableLock(stub.windowTable);
    11831188    crHashtableLock(stub.contextTable);
    11841189
     
    12011206#endif
    12021207    crHashtableUnlock(stub.contextTable);
     1208    crHashtableUnlock(stub.windowTable);
    12031209}
    12041210
  • trunk/src/VBox/Additions/common/crOpenGL/load.c

    r39602 r39631  
    340340    //delete all created contexts
    341341    stubMakeCurrent( NULL, NULL);
     342
     343    /* the lock order is windowTable->contextTable (see wglMakeCurrent_prox, glXMakeCurrent)
     344     * this is why we need to take a windowTable lock since we will later do stub.windowTable access & locking */
     345    crHashtableLock(stub.windowTable);
    342346    crHashtableWalk(stub.contextTable, hsWalkStubDestroyContexts, NULL);
     347    crHashtableUnlock(stub.windowTable);
    343348
    344349    /* shutdown, now trap any calls to a NULL dispatcher */
  • trunk/src/VBox/Additions/common/crOpenGL/stub.c

    r39568 r39631  
    125125}
    126126
     127static void stubWindowCleanupForContextsCB(unsigned long key, void *data1, void *data2)
     128{
     129    ContextInfo *context = (ContextInfo *) data1;
     130
     131    CRASSERT(context);
     132
     133    if (context->currentDrawable == data2)
     134        context->currentDrawable = NULL;
     135}
     136
    127137void APIENTRY crWindowDestroy( GLint window )
    128138{
     
    153163#endif
    154164        crForcedFlush();
     165
     166        crHashtableWalk(stub.contextTable, stubWindowCleanupForContextsCB, winInfo);
     167
    155168        crHashtableDelete(stub.windowTable, window, crFree);
    156169
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette