webengine/widgetengine/src/WidgetEventHandler.cpp
changeset 5 10e98eab6f85
parent 0 dd21522fd290
--- a/webengine/widgetengine/src/WidgetEventHandler.cpp	Fri May 08 08:25:06 2009 +0300
+++ b/webengine/widgetengine/src/WidgetEventHandler.cpp	Fri Jul 03 15:54:40 2009 +0100
@@ -17,6 +17,7 @@
 #include "WidgetEventHandler.h"
 #include "config.h"
 #include <kjs/object.h>
+#include "WidgetJSObjectProtector.h"
 
 // ============================ MEMBER FUNCTIONS ===============================
 using namespace KJS;
@@ -28,10 +29,13 @@
 //
 //
 // ----------------------------------------------------------------------------
-WidgetEventHandler::WidgetEventHandler( JSValue* aValue, ExecState* aExecState ) : iGlobalExecState (aExecState)
+WidgetEventHandler::WidgetEventHandler( JSValue* aValue, ExecState* aExecState, MJSObjectProtector* aProtector) : iGlobalExecState (aExecState), iProtector(aProtector)
 {
     iEventHandler = aValue;
-    Collector::protect(iEventHandler);    
+    if(iProtector)
+        {
+	    iProtector->Protect(iEventHandler);
+	    }
 }
 
 
@@ -43,7 +47,10 @@
 // ----------------------------------------------------------------------------
 WidgetEventHandler::~WidgetEventHandler()
 {
-    Collector::unprotect(iEventHandler);
+    if(iProtector) 
+        {
+	    iProtector->Unprotect(iEventHandler);
+	    }
 }
 
 // ----------------------------------------------------------------------------