Author: everaldo
Date: 2007-06-07 06:48:33 -0400 (Thu, 07 Jun 2007)
New Revision: 78828

Modified:
   trunk/moon/plugin/moon-plugin.cpp
   trunk/moon/plugin/moon-plugin.h
Log:


Modified: trunk/moon/plugin/moon-plugin.cpp
===================================================================
--- trunk/moon/plugin/moon-plugin.cpp   2007-06-07 10:37:18 UTC (rev 78827)
+++ trunk/moon/plugin/moon-plugin.cpp   2007-06-07 10:48:33 UTC (rev 78828)
@@ -111,6 +111,7 @@
     this->instance = instance;
     this->window = NULL;
     this->scriptclass = NULL;
+       this->object = NULL;
 }
 
 PluginInstance::~PluginInstance ()
@@ -142,10 +143,13 @@
                        break;
 
                case NPPVpluginScriptableNPObject:
-                       if (this->scriptclass)
-                               *(NPObject**)result = NPN_CreateObject 
(this->instance, this->scriptclass);
+                       if (!this->object)
+                               this->object = NPN_CreateObject 
(this->instance, scriptclass);
+
+                       if (!this->object)
+                               err = NPERR_OUT_OF_MEMORY_ERROR;
                        else
-                               err = NPERR_GENERIC_ERROR;
+                               *((NPObject **) result) = NPN_RetainObject 
(this->object);
 
                        break;
 

Modified: trunk/moon/plugin/moon-plugin.h
===================================================================
--- trunk/moon/plugin/moon-plugin.h     2007-06-07 10:37:18 UTC (rev 78827)
+++ trunk/moon/plugin/moon-plugin.h     2007-06-07 10:48:33 UTC (rev 78828)
@@ -55,6 +55,7 @@
        bool xembed_supported; // XEmbed Extension supported
 
     NPClass *scriptclass;  // JavaScript class
+       NPObject *object;      // JavaScript object
 
  public:       
        PluginInstance (NPP instance, uint16 mode);

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to