Fix memory issues for XMLHttpRequest & WebSocket (#12271)

* Add missing addRef for Http relevant classes.

* Fix all XMLHttpRequest instances are leak.

* Fix unroot logic in jsb_websocket.cpp
This commit is contained in:
James Chen
2022-07-29 15:52:17 +08:00
committed by GitHub
parent 2f4896ec9e
commit fc6ff454b9
4 changed files with 16 additions and 3 deletions
+1
View File
@@ -833,6 +833,7 @@ HttpClient::HttpClient()
_cookie(nullptr),
_requestSentinel(ccnew HttpRequest()) {
CC_LOG_DEBUG("In the constructor of HttpClient!");
_requestSentinel->addRef();
if (gThreadPool == nullptr) {
gThreadPool = LegacyThreadPool::newFixedThreadPool(4);
}