From 7295cc0f3979d3e30fdbdb6d56a79dd79459b334 Mon Sep 17 00:00:00 2001 From: Alexander Shabalin Date: Thu, 26 Mar 2020 13:05:44 +0300 Subject: [PATCH] Remove unneeded addHeapRef --- runtime/src/main/cpp/Memory.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/runtime/src/main/cpp/Memory.cpp b/runtime/src/main/cpp/Memory.cpp index c0ca081afd1..bb4285bdcc2 100644 --- a/runtime/src/main/cpp/Memory.cpp +++ b/runtime/src/main/cpp/Memory.cpp @@ -2046,7 +2046,6 @@ OBJ_GETTER(initSharedInstance, } ObjHeader* object = AllocInstance(typeInfo, OBJ_RESULT); memoryState->initializingSingletons.push_back(std::make_pair(location, object)); - addHeapRef(object); #if KONAN_NO_EXCEPTIONS ctor(object); if (Strict) @@ -2054,7 +2053,6 @@ OBJ_GETTER(initSharedInstance, UpdateHeapRef(location, object); synchronize(); memoryState->initializingSingletons.pop_back(); - releaseHeapRef(object); return object; #else // KONAN_NO_EXCEPTIONS try { @@ -2064,13 +2062,11 @@ OBJ_GETTER(initSharedInstance, UpdateHeapRef(location, object); synchronize(); memoryState->initializingSingletons.pop_back(); - releaseHeapRef(object); return object; } catch (...) { UpdateReturnRef(OBJ_RESULT, nullptr); zeroHeapRef(location); memoryState->initializingSingletons.pop_back(); - releaseHeapRef(object); synchronize(); throw; }