[EFL] Remove entry pointer before freeing it from matrix.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 3 Dec 2011 01:59:48 +0000 (01:59 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 3 Dec 2011 01:59:48 +0000 (01:59 +0000)
https://bugs.webkit.org/show_bug.cgi?id=73625

Patch by JungJik Lee <jungjik.lee@samsung.com> on 2011-12-02
Reviewed by Ryosuke Niwa.

To prevent leaving dangling pointer on the matrix, remove the entry before freeing it.

* ewk/ewk_tiled_matrix.cpp:
(ewk_tile_matrix_free):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@101887 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/efl/ChangeLog
Source/WebKit/efl/ewk/ewk_tiled_matrix.cpp

index dc17ab1b3e276acfe13410b22abd9b936da53b37..f49fc61af9763803ddc6332453acfc6b1551f44f 100755 (executable)
@@ -1,3 +1,15 @@
+2011-12-02  JungJik Lee  <jungjik.lee@samsung.com>
+
+        [EFL] Remove entry pointer before freeing it from matrix.
+        https://bugs.webkit.org/show_bug.cgi?id=73625
+
+        Reviewed by Ryosuke Niwa.
+
+        To prevent leaving dangling pointer on the matrix, remove the entry before freeing it.
+
+        * ewk/ewk_tiled_matrix.cpp:
+        (ewk_tile_matrix_free):
+
 2011-12-01  Ryuan Choi  <ryuan.choi@samsung.com>
 
         [EFL] Cleanup includes to reduce code complexity.
 2011-12-01  Ryuan Choi  <ryuan.choi@samsung.com>
 
         [EFL] Cleanup includes to reduce code complexity.
index c3a596d418c836a89d718e97b69b1266d64278f8..69236b59960df67f63561c6d4a46f4a449395c40 100644 (file)
@@ -302,7 +302,8 @@ void ewk_tile_matrix_free(Ewk_Tile_Matrix* tileMatrix)
     ewk_tile_unused_cache_freeze(tileMatrix->tilieUnusedCache);
     ewk_tile_matrix_invalidate(tileMatrix);
     entry = EINA_INLIST_CONTAINER_GET(tileMatrix->matrices, Ewk_Tile_Matrix_Entry);
     ewk_tile_unused_cache_freeze(tileMatrix->tilieUnusedCache);
     ewk_tile_matrix_invalidate(tileMatrix);
     entry = EINA_INLIST_CONTAINER_GET(tileMatrix->matrices, Ewk_Tile_Matrix_Entry);
-    eina_matrixsparse_free(entry->matrix);    
+    tileMatrix->matrices = eina_inlist_remove(tileMatrix->matrices, (Eina_Inlist *)entry);
+    eina_matrixsparse_free(entry->matrix);
     free(entry);
     tileMatrix->matrices = 0;
 
     free(entry);
     tileMatrix->matrices = 0;