Make memnew(RefCounted) return Ref, to force callers to take ownership of it through a reference.
This commit is contained in:
@@ -138,8 +138,8 @@ void EngineDebugger::initialize(const String &p_uri, bool p_skip_breakpoints, bo
|
||||
CreatePeerFunc *create_fn = protocols.getptr(proto);
|
||||
ERR_FAIL_NULL_MSG(create_fn, vformat("Invalid protocol: %s.", proto));
|
||||
|
||||
RemoteDebuggerPeer *peer = (*create_fn)(p_uri);
|
||||
if (!peer) {
|
||||
Ref<RemoteDebuggerPeer> peer = (*create_fn)(p_uri);
|
||||
if (peer.is_null()) {
|
||||
return;
|
||||
}
|
||||
singleton = memnew(RemoteDebugger(Ref<RemoteDebuggerPeer>(peer)));
|
||||
|
||||
Reference in New Issue
Block a user