VirtualBox

Ignore:
Timestamp:
Jul 17, 2009 9:45:16 AM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
50214
Message:

crOpenGL: fix memory leaks when terminating guest apps

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/OpenGL/util/hash.c

    r15532 r21668  
    316316{
    317317    int i;
     318    CRHashNode *entry, *next;
    318319
    319320    if ( !hash) return;
     
    325326    for ( i = 0; i < CR_NUM_BUCKETS; i++ )
    326327    {
    327         if ( hash->buckets[i] )
    328         {
    329             if (hash->buckets[i]->data && deleteFunc) {
    330                 /* Clear the key in case crHashtableDelete() is called
    331                  * from this callback.
    332                  */
    333                 hash->buckets[i]->key = 0;
    334                 (*deleteFunc)( hash->buckets[i]->data );
    335             }
    336             crFree( hash->buckets[i] );
     328        entry = hash->buckets[i];
     329        while (entry)
     330        {
     331            next = entry->next;
     332            /* Clear the key in case crHashtableDelete() is called
     333             * from this callback.
     334             */
     335            entry->key = 0;
     336            if (deleteFunc && entry->data)
     337            {
     338                (*deleteFunc)(entry->data);
     339            }
     340            crFree(entry);
     341            entry = next;
     342
    337343        }
    338344    }
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