Allow Ref `instantiate` to accept constructor args

This commit is contained in:
Thaddeus Crews 2024-02-10 13:19:14 -06:00
parent 4e990cd7e5
commit b3cac9c092
No known key found for this signature in database
GPG Key ID: 62181B86FE9E5D84
2 changed files with 4 additions and 3 deletions

View File

@ -665,7 +665,7 @@ RemoteDebugger::RemoteDebugger(Ref<RemoteDebuggerPeer> p_peer) {
// Performance Profiler
Object *perf = Engine::get_singleton()->get_singleton_object("Performance");
if (perf) {
performance_profiler = Ref<PerformanceProfiler>(memnew(PerformanceProfiler(perf)));
performance_profiler.instantiate(perf);
performance_profiler->bind("performance");
profiler_enable("performance", true);
}

View File

@ -212,8 +212,9 @@ public:
reference = nullptr;
}
void instantiate() {
ref(memnew(T));
template <typename... VarArgs>
void instantiate(VarArgs... p_params) {
ref(memnew(T(p_params...)));
}
Ref() {}