SAMPLES: Fixed memory leak in of presentMode data.
authorMark Young <marky@lunarg.com>
Mon, 25 Jan 2016 21:43:50 +0000 (14:43 -0700)
committerMark Young <marky@lunarg.com>
Mon, 25 Jan 2016 23:04:01 +0000 (16:04 -0700)
We were leaking the presentMode array data, now it's freed.

demos/cube.c
demos/tri.c

index 18bf12e..4747371 100644 (file)
@@ -927,6 +927,10 @@ static void demo_prepare_buffers(struct demo *demo)
                 &color_image_view, NULL, &demo->buffers[i].view);
         assert(!err);
     }
+    
+    if (NULL != presentModes) {
+        free(presentModes);
+    }
 }
 
 static void demo_prepare_depth(struct demo *demo)
index b0663b4..6b17eb3 100644 (file)
@@ -718,6 +718,10 @@ static void demo_prepare_buffers(struct demo *demo)
     }
 
     demo->current_buffer = 0;
+    
+    if (NULL != presentModes) {
+        free(presentModes);
+    }
 }
 
 static void demo_prepare_depth(struct demo *demo)