util: Use sizeof(void *) rather than 0 as the fallback cache line size
[mesa.git] / src / gallium / state_trackers / vdpau / htab.c
index 0c9580553748b14b152a208d1d5c79c1aa40d448..8b809f2cb5e042d60f616f7d2aa95c33281d0394 100644 (file)
@@ -25,8 +25,8 @@
  *
  **************************************************************************/
 
-#include <util/u_handle_table.h>
-#include <os/os_thread.h>
+#include "util/u_handle_table.h"
+#include "os/os_thread.h"
 #include "vdpau_private.h"
 
 #ifdef VL_HANDLES
@@ -55,7 +55,7 @@ void vlDestroyHTAB(void)
 {
 #ifdef VL_HANDLES
    pipe_mutex_lock(htab_lock);
-   if (htab) {
+   if (htab && !handle_table_get_first_handle(htab)) {
       handle_table_destroy(htab);
       htab = NULL;
    }
@@ -92,3 +92,13 @@ void* vlGetDataHTAB(vlHandle handle)
    return (void*)handle;
 #endif
 }
+
+void vlRemoveDataHTAB(vlHandle handle)
+{
+#ifdef VL_HANDLES
+   pipe_mutex_lock(htab_lock);
+   if (htab)
+      handle_table_remove(htab, handle);
+   pipe_mutex_unlock(htab_lock);
+#endif
+}