We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 49223a9 commit 704bc54Copy full SHA for 704bc54
app/src/cpp_instance_manager.h
@@ -85,11 +85,9 @@ class CppInstanceManager {
85
CppInstanceManager& operator=(CppInstanceManager&&) = delete;
86
87
/// @brief Increase the reference count by 1.
88
- /// @return Reference count after increment.
+ /// @return Reference count after increment. Return -1 if invalid instance.
89
int AddReference(InstanceClass* instance) {
90
- FIREBASE_DEV_ASSERT_MESSAGE(instance,
91
- "Null pointer is passed to AddReference<%s>().",
92
- typeid(InstanceClass).name());
+ if (!instance) return -1;
93
MutexLock lock(manager_mutex_);
94
auto it = container_.find(instance);
95
if (it != container_.end()) {
0 commit comments