diff Framework/Messages/ICallable.h @ 977:262a0244e9b2 toa2019090201

Added missing Unregister for objects that register by the broker + logs + guard in FetchContext
author Benjamin Golinvaux <bgo@osimis.io>
date Mon, 02 Sep 2019 17:29:26 +0200
parents e75fd08d6c75
children 18d53a8b41b7 c20dbaab360c
line wrap: on
line diff
--- a/Framework/Messages/ICallable.h	Sat Aug 31 13:50:11 2019 +0200
+++ b/Framework/Messages/ICallable.h	Mon Sep 02 17:29:26 2019 +0200
@@ -78,13 +78,21 @@
 
     void ApplyInternal(const TMessage& message)
     {
-      if (observerFingerprint_ != observer_.GetFingerprint())
+      std::string currentFingerprint(observer_.GetFingerprint());
+      if (observerFingerprint_ != currentFingerprint)
       {
-        LOG(TRACE) << "The observer at address " << std::hex << &observer_ << std::dec << ") has a different fingerprint than the one recorded at callback registration time. This means that it is not the same object as the one recorded, even though their addresses are the same.  Callback will NOT be sent!";
-        LOG(TRACE) << " recorded fingerprint = " << observerFingerprint_ << " current fingerprint = " << observer_.GetFingerprint();
+        LOG(TRACE) << "The observer at address " << 
+          std::hex << &observer_ << std::dec << 
+          ") has a different fingerprint than the one recorded at callback " <<
+          "registration time. This means that it is not the same object as " <<
+          "the one recorded, even though their addresses are the same. " <<
+          "Callback will NOT be sent!";
+        LOG(TRACE) << " recorded fingerprint = " << observerFingerprint_ << 
+          " current fingerprint = " << currentFingerprint;
       }
       else
       {
+        LOG(TRACE) << "The recorded fingerprint is " << observerFingerprint_ << " and the current fingerprint is " << currentFingerprint << " -- callable will be called.";
         (observer_.*function_) (message);
       }
     }