]> git.sesse.net Git - vlc/blobdiff - modules/video_output/opengl.c
Fix potential memleak.
[vlc] / modules / video_output / opengl.c
index 13666f9b381b1831e86c0348543e6f98147fab75..32d56e256f6af68184698eb381855b16bbc7e196 100644 (file)
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <errno.h>                                                 /* ENOMEM */
 
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <errno.h>                                                 /* ENOMEM */
+
+#include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_vout.h>
 
     #define SIGN(x)     (x < 0 ? (-1) : 1)
     #define PID2     1.570796326794896619231322
 
-    static const char *ppsz_effects[] = {
+    static const char *const ppsz_effects[] = {
             "none", "cube", "transparent-cube", "cylinder", "torus", "sphere","SQUAREXY","SQUARER", "ASINXY", "ASINR", "SINEXY", "SINER" };
-    static const char *ppsz_effects_text[] = {
+    static const char *const ppsz_effects_text[] = {
             N_("None"), N_("Cube"), N_("Transparent Cube"),
             N_("Cylinder"), N_("Torus"), N_("Sphere"), N_("SQUAREXY"),N_("SQUARER"), N_("ASINXY"), N_("ASINR"), N_("SINEXY"), N_("SINER") };
 #endif
@@ -175,9 +176,9 @@ static void Transform    ( int, float, float, int, int, int, int, double *, doub
     "Several visual OpenGL effects are available." )
 
 #ifndef OPENGL_MORE_EFFECT
-static const char *ppsz_effects[] = {
+static const char *const ppsz_effects[] = {
         "none", "cube", "transparent-cube" };
-static const char *ppsz_effects_text[] = {
+static const char *const ppsz_effects_text[] = {
         N_("None"), N_("Cube"), N_("Transparent Cube") };
 #endif
 
@@ -565,7 +566,6 @@ static void DestroyVout( vlc_object_t *p_this )
     vout_sys_t *p_sys = p_vout->p_sys;
 
     module_Unneed( p_sys->p_vout, p_sys->p_vout->p_module );
-    vlc_object_detach( p_sys->p_vout );
     vlc_object_release( p_sys->p_vout );
 
     free( p_sys );