From 3e37795d62049c8e39be9379f105a068bd54bee4 Mon Sep 17 00:00:00 2001 From: Ari Lazier Date: Wed, 9 Nov 2016 18:01:56 -0800 Subject: [PATCH] fix for unregistering notifications in a notification --- src/js_realm.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/js_realm.hpp b/src/js_realm.hpp index a670224c..456abf87 100644 --- a/src/js_realm.hpp +++ b/src/js_realm.hpp @@ -120,7 +120,8 @@ class RealmDelegate : public BindingContext { arguments[0] = realm_object; arguments[1] = Value::from_string(m_context, notification_name); - for (auto &callback : m_notifications) { + std::list> notifications_copy(m_notifications); + for (auto &callback : notifications_copy) { Function::call(m_context, callback, realm_object, 2, arguments); } }