You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ky...@apache.org on 2018/12/20 07:10:09 UTC

[incubator-weex] branch master updated: [core] fix crash error when erase event (#1940)

This is an automated email from the ASF dual-hosted git repository.

kyork pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-weex.git


The following commit(s) were added to refs/heads/master by this push:
     new 9148988  [core] fix crash error when erase event (#1940)
9148988 is described below

commit 91489880b0a8f3f2910de9caae4ed06fd4e989bb
Author: jianhan-he <41...@users.noreply.github.com>
AuthorDate: Thu Dec 20 15:10:04 2018 +0800

    [core] fix crash error when erase event (#1940)
---
 weex_core/Source/core/data_render/vnode/vnode_render_manager.cc | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/weex_core/Source/core/data_render/vnode/vnode_render_manager.cc b/weex_core/Source/core/data_render/vnode/vnode_render_manager.cc
index 9736d4b..5875fee 100644
--- a/weex_core/Source/core/data_render/vnode/vnode_render_manager.cc
+++ b/weex_core/Source/core/data_render/vnode/vnode_render_manager.cc
@@ -871,13 +871,13 @@ void CompareAndApplyEvents1(const std::string& page_id, VNode* old_node,
 
   for (auto it = old_events.cbegin(); it != old_events.cend(); it++) {
     auto pos = new_events.find(it->first);
-    if (pos == new_events.end()) {
+    if (pos != new_events.end()) {
       new_events.erase(pos);
     }
   }
   for (auto it = new_events.cbegin(); it != new_events.cend(); it++) {
     auto pos = old_events.find(it->first);
-    if (pos == old_events.end()) {
+    if (pos != old_events.end()) {
       old_events.erase(pos);
     }
   }
@@ -899,14 +899,14 @@ void CompareAndApplyEvents2(const std::string& page_id, VNode* old_node,
   for (auto it = old_events.cbegin(); it != old_events.cend(); it++) {
     auto pos = new_events.find(it->first);
 
-    if (pos == new_events.end()) {
+    if (pos != new_events.end()) {
       new_events.erase(pos);
     }
   }
   for (auto it = new_events.cbegin(); it != new_events.cend(); it++) {
     auto pos = old_events.find(it->first);
 
-    if (pos == old_events.end()) {
+    if (pos != old_events.end()) {
       old_events.erase(pos);
     }
   }