[clutter-gst/clutter-gst-2.0] video-sink: don't use strings that can be freed in shader cache



commit e289cc17945d9972d60276965aeba6568c05428b
Author: Lionel Landwerlin <llandwerlin gmail com>
Date:   Mon Dec 16 13:58:53 2013 +0000

    video-sink: don't use strings that can be freed in shader cache
    
    Patch by Vladimir Caruntu

 clutter-gst/clutter-gst-video-sink.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/clutter-gst/clutter-gst-video-sink.c b/clutter-gst/clutter-gst-video-sink.c
index 2c8f75a..88430db 100644
--- a/clutter-gst/clutter-gst-video-sink.c
+++ b/clutter-gst/clutter-gst-video-sink.c
@@ -691,14 +691,15 @@ _get_cached_cogl_program (const char *source)
 
   if (G_UNLIKELY (program_cache == NULL)) {
     program_cache = g_hash_table_new_full (g_str_hash, g_str_equal,
-                                           NULL, (GDestroyNotify) cogl_handle_unref);
+                                           (GDestroyNotify) g_free,
+                                           (GDestroyNotify) cogl_handle_unref);
   }
 
   handle = (CoglHandle) g_hash_table_lookup (program_cache, (gpointer) source);
   if (handle == COGL_INVALID_HANDLE) {
     handle = _create_cogl_program (source);
     g_hash_table_insert (program_cache,
-                         (gpointer) source,
+                         (gpointer) g_strdup (source),
                          (gpointer) cogl_handle_ref (handle));
   }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]