gallium: Don't be pedantic about removing non exiting items from the table.
authorJosé Fonseca <jrfonseca@tungstengraphics.com>
Tue, 18 Mar 2008 11:49:29 +0000 (11:49 +0000)
committerJosé Fonseca <jrfonseca@tungstengraphics.com>
Tue, 18 Mar 2008 17:20:56 +0000 (17:20 +0000)
src/gallium/auxiliary/util/u_handle_table.c

index d25872972aac2c200fd48a788f406f739e2c71d4..fae4ac4039c263bce4d5cadf9065842801f3d6c2 100644 (file)
@@ -226,9 +226,13 @@ handle_table_remove(struct handle_table *ht,
 
    index = handle - 1;
    object = ht->objects[index];
-   assert(object);
+   if(!object) {
+      /* XXX: this warning may be noisy for legitimate use -- remove later */
+      debug_warning("removing empty handle");
+      return;
+   }
    
-   if(object && ht->destroy)
+   if(ht->destroy)
       ht->destroy(object);
 
    ht->objects[index] = NULL;