BIND 10 trac2980, updated. 43ea555f6ae497ec40672b951d8a00c437b89c0a [2980] Made LibraryHandle copy constructor and assignment operator private.

BIND 10 source code commits bind10-changes at lists.isc.org
Thu Jul 4 11:53:59 UTC 2013


The branch, trac2980 has been updated
       via  43ea555f6ae497ec40672b951d8a00c437b89c0a (commit)
      from  04e36988a16fb36ab84ec548a174b148924ed0d7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 43ea555f6ae497ec40672b951d8a00c437b89c0a
Author: Stephen Morris <stephen at isc.org>
Date:   Thu Jul 4 12:53:09 2013 +0100

    [2980] Made LibraryHandle copy constructor and assignment operator private.
    
    This reduces the risk of someone taking a copy and being left with
    a "dangling pointer" to a callout manager.

-----------------------------------------------------------------------

Summary of changes:
 src/lib/hooks/library_handle.h |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

-----------------------------------------------------------------------
diff --git a/src/lib/hooks/library_handle.h b/src/lib/hooks/library_handle.h
index 6cf522c..4fe47cd 100644
--- a/src/lib/hooks/library_handle.h
+++ b/src/lib/hooks/library_handle.h
@@ -116,6 +116,25 @@ public:
     bool deregisterAllCallouts(const std::string& name);
 
 private:
+    /// @brief Copy constructor
+    ///
+    /// Private (with no implementation) as it makes no sense to copy an object
+    /// of this type.  All code receives a reference to an existing handle which
+    /// is tied to a particular CalloutManager.  Creating a copy of that handle
+    /// runs the risk of a "dangling pointer" to the original handle's callout
+    /// manager.
+    ///
+    /// @param Unused - should be the object to copy.
+    LibraryHandle(const LibraryHandle&);
+
+    /// @brief Assignment operator
+    ///
+    /// Declared private like the copy constructor for the same reasons. It too
+    /// has no implementation.
+    ///
+    /// @param Unused - should be the object to copy.
+    LibraryHandle& operator=(const LibraryHandle&);
+
     /// Back pointer to the collection object for the library
     CalloutManager* callout_manager_;
 



More information about the bind10-changes mailing list