changeset 24959:f13b32b2bee4

Fix cmd filter memory leak, free the cmd after filter ate it.
author ulion
date Thu, 08 Nov 2007 05:19:56 +0000
parents d86224fac2b5
children 983806685c44
files input/input.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/input/input.c	Wed Nov 07 01:44:41 2007 +0000
+++ b/input/input.c	Thu Nov 08 05:19:56 2007 +0000
@@ -1294,8 +1294,13 @@
   if(!ret) return NULL;
 
   for(cf = cmd_filters ; cf ; cf = cf->next) {
-    if(cf->filter(ret,paused,cf->ctx))
+    if(cf->filter(ret,paused,cf->ctx)) {
+      if (peek_only && from_queue)
+        // The filter ate the cmd, so we remove it from queue
+        ret = mp_input_get_queued_cmd(0);
+      mp_cmd_free(ret);
       return NULL;
+    }
   }
 
   if (!from_queue && peek_only)