#include "pipe/p_compiler.h"
-#include "pipe/p_debug.h"
+#include "util/u_debug.h"
#include "util/u_memory.h"
#include "util/u_handle_table.h"
void (*destroy)(void *object))
{
assert(ht);
+ if (!ht)
+ return;
ht->destroy = destroy;
}
assert(ht);
assert(object);
- if(!object)
+ if(!object || !ht)
return 0;
/* linear search for an empty handle */
assert(ht);
assert(handle);
- if(!handle)
+ if(!handle || !ht)
return 0;
assert(object);
assert(ht);
assert(handle);
- if(!handle || handle > ht->size)
+ if(!handle || !ht || handle > ht->size)
return NULL;
object = ht->objects[handle - 1];
assert(ht);
assert(handle);
- if(!handle || handle > ht->size)
+ if(!handle || !ht || handle > ht->size)
return;
index = handle - 1;
unsigned index;
assert(ht);
+ if (!ht)
+ return;
+
if(ht->destroy)
for(index = 0; index < ht->size; ++index)
handle_table_clear(ht, index);