In TV plus test case, HBB team found some memory from ewk intercept
request interface have never been released.
Test case: Repeatly raise Tv plus and exit.
hbbtv_app process never exit, each time raising Tv plus, many ewk intercept
request instances and ProxyingURLLoaderEfl instances will be leaked:
1. In ProxyingURLLoaderFactoryEfl::CreateLoaderAndStart,
when intercept_request->is_ignored(),
the new _Ewk_Intercept_Request will be leak;
2. In ProxyingURLLoaderFactoryEfl::CreateLoaderAndStart,
after creating, the created ProxyingURLLoaderEfl never dtor;
3. In _Ewk_Intercept_Request::put_chunk, when delegate_ is null,
the function input "char* data" will be leaked.
4. In ProxyingURLLoaderEfl::PutChunk, the instance dose not emplace
the input data memory nor delete it.
Reference:
- https://review.tizen.org/gerrit/283460/
Change-Id: Icb5d95ea5e201e9f8beb24914b14822b2e99957e
Signed-off-by: feifei08.liu <feifei08.liu@samsung.com>
void ProxyingURLLoaderEfl::PutChunk(const char* data, size_t length) {
AddRawDataIntoBuffer(data, length);
+ if (data)
+ delete data;
}
void ProxyingURLLoaderEfl::ChunkedReadDone() {
client_->OnComplete(network::URLLoaderCompletionStatus(error));
producer_handle_watcher_.reset();
producer_handle_.reset();
+ binding_.reset();
client_.reset();
weak_ptr_factory_.InvalidateWeakPtrs();
MaybeDeleteSelf();
void _Ewk_Intercept_Request::put_chunk(const char* data, size_t length) {
if (delegate_)
delegate_->PutChunk(data, length);
+ else
+ delete data;
}
void _Ewk_Intercept_Request::post_put_chunk(const char* data, size_t length) {