diff options
-rw-r--r-- | ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_messaging_rpc_server.cc | 6 | ||||
-rw-r--r-- | webkit/plugins/ppapi/message_channel.cc | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_messaging_rpc_server.cc b/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_messaging_rpc_server.cc index 062bb5b..0676b16 100644 --- a/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_messaging_rpc_server.cc +++ b/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_messaging_rpc_server.cc @@ -13,6 +13,7 @@ #endif using ppapi_proxy::PPBMessagingInterface; +using ppapi_proxy::PPBVarInterface; using ppapi_proxy::DebugPrintf; using ppapi_proxy::DeserializeTo; @@ -30,6 +31,11 @@ void PpbMessagingRpcServer::PPB_Messaging_PostMessage( return; PPBMessagingInterface()->PostMessage(instance, message); + + // In the case of a string, DeserializeTo creates a PP_Var with a reference- + // count of 1. We must release the var, or it will stay in the browser's map. + PPBVarInterface()->Release(message); + DebugPrintf("PPB_Messaging::PostMessage: instance=%"NACL_PRIu32"\n", instance); diff --git a/webkit/plugins/ppapi/message_channel.cc b/webkit/plugins/ppapi/message_channel.cc index 4e9e82883..cc0026e 100644 --- a/webkit/plugins/ppapi/message_channel.cc +++ b/webkit/plugins/ppapi/message_channel.cc @@ -159,6 +159,7 @@ bool MessageChannelInvoke(NPObject* np_obj, NPIdentifier name, MessageChannel& message_channel(ToMessageChannel(np_obj)); PP_Var argument(NPVariantToPPVar(message_channel.instance(), &args[0])); message_channel.PostMessageToNative(argument); + PpapiGlobals::Get()->GetVarTracker()->ReleaseVar(argument); return true; } // Other method calls we will pass to the passthrough object, if we have one. |