summaryrefslogtreecommitdiff
path: root/DevTools
diff options
context:
space:
mode:
authorAndrew Kaster <andrewdkaster@gmail.com>2020-12-31 00:55:56 -0700
committerAndreas Kling <kling@serenityos.org>2020-12-31 21:59:20 +0100
commit2b3993b008016eef6752024474eb8a45545caf3f (patch)
tree6466ec0156df159c0abeb1c5f15d4c5d5f6a3d24 /DevTools
parentb7fd5315e512a64dac08f53c0b5128da94bf72f0 (diff)
downloadserenity-2b3993b008016eef6752024474eb8a45545caf3f.zip
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.
Diffstat (limited to 'DevTools')
-rw-r--r--DevTools/HackStudio/HackStudioWidget.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/DevTools/HackStudio/HackStudioWidget.cpp b/DevTools/HackStudio/HackStudioWidget.cpp
index 0fed336232..f1ca53cf9a 100644
--- a/DevTools/HackStudio/HackStudioWidget.cpp
+++ b/DevTools/HackStudio/HackStudioWidget.cpp
@@ -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();
});
}