diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-09-21 10:13:34 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-09-21 15:25:08 +0200 |
commit | 4298ba25c3b9909781cebc4719af82056591572b (patch) | |
tree | 3db1fec1e15388d8cd60054bff990e9ffef8fbfc /Libraries/LibCore/CHttpJob.cpp | |
parent | 1f5a9762a2b9e3449be7e61327c100d2e1f3e9db (diff) | |
download | serenity-4298ba25c3b9909781cebc4719af82056591572b.zip |
LibCore: Convert CTCPSocket to ObjectPtr, add construct() helper
The C_OBJECT macro now also inserts a static construct(...) helper into
the class. Now we can make the constructor(s) private and instead call:
auto socket = CTCPSocket::construct(arguments);
construct() returns an ObjectPtr<T>, which we'll later switch to being
a NonnullRefPtr<T>, once everything else in in place for ref-counting.
Diffstat (limited to 'Libraries/LibCore/CHttpJob.cpp')
-rw-r--r-- | Libraries/LibCore/CHttpJob.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Libraries/LibCore/CHttpJob.cpp b/Libraries/LibCore/CHttpJob.cpp index 716d170acb..472aae01d9 100644 --- a/Libraries/LibCore/CHttpJob.cpp +++ b/Libraries/LibCore/CHttpJob.cpp @@ -116,7 +116,7 @@ void CHttpJob::finish_up() void CHttpJob::start() { ASSERT(!m_socket); - m_socket = new CTCPSocket(this); + m_socket = CTCPSocket::construct(this); m_socket->on_connected = [this] { dbg() << "CHttpJob: on_connected callback"; on_socket_connected(); |