From 50b904edd71e4e9e5a3780cf05cd3a14c3b64773 Mon Sep 17 00:00:00 2001 From: Jason Rose Date: Wed, 14 Aug 2013 17:15:29 -0700 Subject: [PATCH] Deallocating both onload and onerror handlers. --- src/Image.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Image.cc b/src/Image.cc index 72c5df5..cbb41db 100644 --- a/src/Image.cc +++ b/src/Image.cc @@ -346,6 +346,11 @@ Image::loaded() { if (onload != NULL) { onload->Call(0, NULL); delete onload; + onload = NULL; + } + if (onerror != NULL) { + delete onerror; + onerror = NULL; } } @@ -360,6 +365,11 @@ Image::error(Local err) { Local argv[1] = { err }; onerror->Call(1, argv); delete onerror; + onerror = NULL; + } + if (onload != NULL) { + delete onload; + onload = NULL; } }