diff --git a/vhook/fish.c b/vhook/fish.c
index 86ae1a474bef0d02b54a7b15e4b9de9add4fd3e1..2de265feb19bffd6ffa394ea2d297107bcebcbf3 100644
--- a/vhook/fish.c
+++ b/vhook/fish.c
@@ -82,6 +82,11 @@ static void dorange(const char *s, int *first, int *second, int maxval)
         *second = maxval;
 }
 
+void Release(void *ctx)
+{
+    if (ctx)
+        av_free(ctx);
+}
 
 int Configure(void **ctxp, int argc, char *argv[])
 {
@@ -325,6 +330,3 @@ void Process(void *ctx, AVPicture *picture, enum PixelFormat pix_fmt, int width,
     }
 }
 
-/* To ensure correct typing */
-FrameHookConfigureFn ConfigureFn = Configure;
-FrameHookProcessFn ProcessFn = Process;
diff --git a/vhook/imlib2.c b/vhook/imlib2.c
index fcc09e17f36f8cc6006edc26e8bbef001420db4e..576b45d004cc01ed236f03e459a0b24254f41e47 100644
--- a/vhook/imlib2.c
+++ b/vhook/imlib2.c
@@ -72,6 +72,19 @@ typedef struct _CachedImage {
     int height;
 } CachedImage;
 
+void Release(void *ctx)
+{
+    ContextInfo *ci;
+    ci = (ContextInfo *) ctx;
+
+    if (ci->cache) {
+        imlib_context_set_image(ci->cache->image);
+        imlib_free_image();
+        av_free(ci->cache);
+    }
+    if (ctx)
+        av_free(ctx);
+}
 
 int Configure(void **ctxp, int argc, char *argv[])
 {
@@ -261,6 +274,3 @@ done:
     ;
 }
 
-/* To ensure correct typing */
-FrameHookConfigureFn ConfigureFn = Configure;
-FrameHookProcessFn ProcessFn = Process;
diff --git a/vhook/null.c b/vhook/null.c
index 1fcb04b1c6b243866570f379d4da875a260e08b1..da35d6e84597cb4e7f0ac128327615769881a03a 100644
--- a/vhook/null.c
+++ b/vhook/null.c
@@ -24,6 +24,14 @@ typedef struct {
     int dummy;
 } ContextInfo;
 
+void Release(void *ctx)
+{
+    ContextInfo *ci;
+    ci = (ContextInfo *) ctx;
+
+    if (ctx)
+        av_free(ctx);
+}
 
 int Configure(void **ctxp, int argc, char *argv[])
 {
@@ -68,6 +76,3 @@ void Process(void *ctx, AVPicture *picture, enum PixelFormat pix_fmt, int width,
     av_free(buf);
 }
 
-/* To ensure correct typing */
-FrameHookConfigureFn ConfigureFn = Configure;
-FrameHookProcessFn ProcessFn = Process;