forked from enlightenment/efl
ecore_evas: fix leaks in macos and win32
memory is duplicated in eina_content_new. Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Differential Revision: https://phab.enlightenment.org/D11641
This commit is contained in:
parent
5565e90479
commit
13d52be7e6
|
@ -531,10 +531,12 @@ _ecore_evas_cocoa_selection_request(Ecore_Evas *ee EINA_UNUSED, unsigned int sea
|
|||
slice.mem = data;
|
||||
}
|
||||
content = eina_content_new(eina_rw_slice_slice_get(slice), mime_type);
|
||||
free(slice.mem); //memory got duplicated in eina_content_new
|
||||
if (!content) // construction can fail because of some validation reasons
|
||||
eina_promise_reject(promise, ecore_evas_no_matching_type);
|
||||
else
|
||||
eina_promise_resolve(promise, eina_value_content_init(content));
|
||||
|
||||
}
|
||||
return future;
|
||||
}
|
||||
|
|
|
@ -1307,6 +1307,7 @@ _ecore_evas_win32_selection_request(Ecore_Evas *ee EINA_UNUSED, unsigned int sea
|
|||
slice.mem = data;
|
||||
}
|
||||
content = eina_content_new(eina_rw_slice_slice_get(slice), mime_type);
|
||||
free(slice.mem); //memory got duplicated in eina_content_new
|
||||
if (!content) // construction can fail because of some validation reasons
|
||||
eina_promise_reject(promise, ecore_evas_no_matching_type);
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue