diff --git a/include/ndn-cpp/node.hpp b/include/ndn-cpp/node.hpp
index 1e4c001..d428378 100644
--- a/include/ndn-cpp/node.hpp
+++ b/include/ndn-cpp/node.hpp
@@ -170,13 +170,21 @@
     }
     
     /**
-     * If this interest is timed out, call onTimeout_ (if defined) and return true.
-     * @param parent The parent Node for the UpcallInfo.
+     * Check if this interest is timed out.
      * @param nowMilliseconds The current time in milliseconds from ndn_getNowMilliseconds.
-     * @return true if this interest timed out and the timeout callback was called, otherwise false.
+     * @return true if this interest timed out, otherwise false.
      */
     bool 
-    checkTimeout(Node *parent, MillisecondsSince1970 nowMilliseconds);
+    isTimedOut(MillisecondsSince1970 nowMilliseconds)
+    {
+      return timeoutTimeMilliseconds_ >= 0.0 && nowMilliseconds >= timeoutTimeMilliseconds_;
+    }
+
+    /**
+     * Call onTimeout_ (if defined).  This ignores exceptions from the onTimeout_.
+     */
+    void 
+    callTimeout();
     
   private:
     ptr_lib::shared_ptr<const Interest> interest_;
diff --git a/src/node.cpp b/src/node.cpp
index d8bcb09..ade4a6e 100644
--- a/src/node.cpp
+++ b/src/node.cpp
@@ -242,8 +242,11 @@
   // Check for PIT entry timeouts.  Go backwards through the list so we can erase entries.
   MillisecondsSince1970 nowMilliseconds = ndn_getNowMilliseconds();
   for (int i = (int)pendingInterestTable_.size() - 1; i >= 0; --i) {
-    if (pendingInterestTable_[i]->checkTimeout(this, nowMilliseconds)) {
+    if (pendingInterestTable_[i]->isTimedOut(nowMilliseconds)) {
+      // Save the PendingInterest and remove it from the PIT.  Then call the callback.
+      shared_ptr<PendingInterest> pendingInterest = pendingInterestTable_[i];
       pendingInterestTable_.erase(pendingInterestTable_.begin() + i);
+      pendingInterest->callTimeout();
       
       // Refresh now since the timeout callback might have delayed.
       nowMilliseconds = ndn_getNowMilliseconds();
@@ -351,22 +354,16 @@
   interest_->get(*interestStruct_);  
 }
 
-bool 
-Node::PendingInterest::checkTimeout(Node *parent, MillisecondsSince1970 nowMilliseconds)
+void 
+Node::PendingInterest::callTimeout()
 {
-  if (timeoutTimeMilliseconds_ >= 0.0 && nowMilliseconds >= timeoutTimeMilliseconds_) {
-    if (onTimeout_) {
-      // Ignore all exceptions.
-      try {
-        onTimeout_(interest_);
-      }
-      catch (...) { }
+  if (onTimeout_) {
+    // Ignore all exceptions.
+    try {
+      onTimeout_(interest_);
     }
-    
-    return true;
+    catch (...) { }
   }
-  else
-    return false;
 }
 
 }
