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

[GitHub] YorkShen closed pull request #1940: [core] fix crash error when erase event

YorkShen closed pull request #1940: [core] fix crash error when erase event
URL: https://github.com/apache/incubator-weex/pull/1940
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

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 9736d4b389..5875fee382 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);
     }
   }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services