| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2010 The Native Client Authors. All rights reserved. | 2 * Copyright 2010 The Native Client Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can | 3 * Use of this source code is governed by a BSD-style license that can |
| 4 * be found in the LICENSE file. | 4 * be found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 #include "native_client/src/shared/ppapi_proxy/plugin_var.h" | 7 #include "native_client/src/shared/ppapi_proxy/plugin_var.h" |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 if (obj_impl != NULL) { | 99 if (obj_impl != NULL) { |
| 100 DebugPrintf("PPB_Var::Release: object(%"NACL_PRIu64")\n", | 100 DebugPrintf("PPB_Var::Release: object(%"NACL_PRIu64")\n", |
| 101 obj_impl->id()); | 101 obj_impl->id()); |
| 102 obj_impl->Release(); | 102 obj_impl->Release(); |
| 103 if (obj_impl->ref_count() == 0) { | 103 if (obj_impl->ref_count() == 0) { |
| 104 if (obj_impl->object_class() == NULL) { | 104 if (obj_impl->object_class() == NULL) { |
| 105 free(obj_impl->object_data()); | 105 free(obj_impl->object_data()); |
| 106 } else { | 106 } else { |
| 107 obj_impl->object_class()->Deallocate(obj_impl->object_data()); | 107 obj_impl->object_class()->Deallocate(obj_impl->object_data()); |
| 108 } | 108 } |
| 109 delete obj_impl; | 109 // TODO(polina): under test/ppapi_geturl this deletes a window object |
| 110 // prematurely. Most likely we are missing an AddRef somewhere. For now |
| 111 // just comment out the delete and leak. |
| 112 // http://code.google.com/p/nativeclient/issues/detail?id=1308 |
| 113 //delete obj_impl; |
| 110 } | 114 } |
| 111 } | 115 } |
| 112 StrImpl* str_impl = VarToStrImpl(var); | 116 StrImpl* str_impl = VarToStrImpl(var); |
| 113 if (str_impl != NULL) { | 117 if (str_impl != NULL) { |
| 114 DebugPrintf("PPB_Var::Release: string('%s')\n", | 118 DebugPrintf("PPB_Var::Release: string('%s')\n", |
| 115 str_impl->str().c_str()); | 119 str_impl->str().c_str()); |
| 116 str_impl->Release(); | 120 str_impl->Release(); |
| 117 if (str_impl->ref_count() == 0) { | 121 if (str_impl->ref_count() == 0) { |
| 118 delete str_impl; | 122 delete str_impl; |
| 119 } | 123 } |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 static_cast<uint32_t>(str.size()), | 448 static_cast<uint32_t>(str.size()), |
| 445 str.c_str()); | 449 str.c_str()); |
| 446 } | 450 } |
| 447 case PP_VARTYPE_OBJECT: | 451 case PP_VARTYPE_OBJECT: |
| 448 DebugPrintf("PP_Var(object: %"NACL_PRIu64")", GetVarId(var)); | 452 DebugPrintf("PP_Var(object: %"NACL_PRIu64")", GetVarId(var)); |
| 449 break; | 453 break; |
| 450 } | 454 } |
| 451 } | 455 } |
| 452 | 456 |
| 453 } // namespace ppapi_proxy | 457 } // namespace ppapi_proxy |
| OLD | NEW |