Browse Source

[master] re-add return to make cppcheck happy

added a comment that at this point this is safe
Jelte Jansen 14 years ago
parent
commit
677c3d8406
2 changed files with 6 additions and 1 deletions
  1. 1 1
      ext/asio/asio/detail/kqueue_reactor.hpp
  2. 5 0
      src/lib/nsas/zone_entry.cc

+ 1 - 1
ext/asio/asio/detail/kqueue_reactor.hpp

@@ -205,7 +205,7 @@ public:
   // Cancel all operations associated with the given descriptor. The
   // handlers associated with the descriptor will be invoked with the
   // operation_aborted error.
-  void cancel_ops(socket_type descriptor, per_descriptor_data& descriptor_data)
+  void cancel_ops(socket_type , per_descriptor_data& descriptor_data)
   {
     mutex::scoped_lock descriptor_lock(descriptor_data->mutex_);
 

+ 5 - 0
src/lib/nsas/zone_entry.cc

@@ -269,6 +269,11 @@ ZoneEntry::removeCallback(const CallbackPtr& callback, AddressFamily family) {
     for (; i != callbacks_[family].end(); ++i) {
         if (*i == callback) {
             callbacks_[family].erase(i);
+            // At this point, a callback should only be in the list
+            // once (enforced by RunningQuery doing only one at a time)
+            // If that changes, we need to revise this (can't delete
+            // elements from a list we're looping over)
+            return;
         }
     }
 }