summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWoochanlee <wc0917.lee@samsung.com>2020-09-17 17:23:10 +0900
committerHermet Park <chuneon.park@samsung.com>2020-09-17 17:23:10 +0900
commitca2900be8a109e3e205a8c49ff11a1f822ae96b7 (patch)
tree9fa4cddea37dd5fa8497fee9ab4757d9363736bb
parente5958965e80724b335fc8b0470d46586e7f29051 (diff)
evas_main: Fix memory leak.
Summary: If the inlist has only one item when it removed. the data is not freed in descturctor. Reviewers: Hermet, raster, vtorri Reviewed By: Hermet Subscribers: vtorri, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D12147
-rw-r--r--src/lib/evas/canvas/evas_main.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/lib/evas/canvas/evas_main.c b/src/lib/evas/canvas/evas_main.c
index 6a84b0c59b..40d242339a 100644
--- a/src/lib/evas/canvas/evas_main.c
+++ b/src/lib/evas/canvas/evas_main.c
@@ -1523,8 +1523,11 @@ _evas_pointer_data_remove(Evas_Public_Data *edata, Evas_Device *pointer, Eina_Bo
1523 EINA_INLIST_FOREACH(pseat->pointers, pdata) 1523 EINA_INLIST_FOREACH(pseat->pointers, pdata)
1524 if (pdata->pointer == pointer) 1524 if (pdata->pointer == pointer)
1525 { 1525 {
1526 pseat->pointers = eina_inlist_remove(pseat->pointers, EINA_INLIST_GET(pdata)); 1526 if (!nofree)
1527 if (!nofree) free(pdata); 1527 {
1528 pseat->pointers = eina_inlist_remove(pseat->pointers, EINA_INLIST_GET(pdata));
1529 free(pdata);
1530 }
1528 hit = pseat; 1531 hit = pseat;
1529 break; 1532 break;
1530 } 1533 }
@@ -1532,8 +1535,11 @@ _evas_pointer_data_remove(Evas_Public_Data *edata, Evas_Device *pointer, Eina_Bo
1532 EINA_SAFETY_ON_NULL_RETURN(hit); 1535 EINA_SAFETY_ON_NULL_RETURN(hit);
1533 if (hit->pointers) return; 1536 if (hit->pointers) return;
1534 hit->object.in = eina_list_free(hit->object.in); 1537 hit->object.in = eina_list_free(hit->object.in);
1535 edata->seats = eina_inlist_remove(edata->seats, EINA_INLIST_GET(hit)); 1538 if (!nofree)
1536 if (!nofree) free(hit); 1539 {
1540 edata->seats = eina_inlist_remove(edata->seats, EINA_INLIST_GET(hit));
1541 free(hit);
1542 }
1537} 1543}
1538 1544
1539Eina_List * 1545Eina_List *