1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-25 21:25:07 +00:00

LibThread: Hide Thread's constructor, as it is a Core::Object

Just constructing one of these guys on the stack willy nilly will leak
the first reference to them. There might be other C_OBJECTs that have
public constructors, seems like a good place for some static analysis
checks :).

Force users to call the construct() method for it.
This commit is contained in:
Andrew Kaster 2020-12-31 00:55:56 -07:00 committed by Andreas Kling
parent b7fd5315e5
commit 2b3993b008
5 changed files with 8 additions and 8 deletions

View file

@ -512,7 +512,7 @@ NonnullRefPtr<GUI::Action> HackStudioWidget::create_debug_action()
}
Debugger::the().set_executable_path(get_project_executable_path());
m_debugger_thread = adopt(*new LibThread::Thread(Debugger::start_static));
m_debugger_thread = LibThread::Thread::construct(Debugger::start_static);
m_debugger_thread->start();
});
}