Browse Source

Deallocating both onload and onerror handlers.

v1.x
Jason Rose 12 years ago
parent
commit
50b904edd7
  1. 10
      src/Image.cc

10
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<Value> err) {
Local<Value> argv[1] = { err };
onerror->Call(1, argv);
delete onerror;
onerror = NULL;
}
if (onload != NULL) {
delete onload;
onload = NULL;
}
}

Loading…
Cancel
Save