[svn] commit: r1268 - /trunk/src/bin/auth/auth_srv.cc

BIND 10 source code commits bind10-changes at lists.isc.org
Wed Mar 10 07:34:41 UTC 2010


Author: jinmei
Date: Wed Mar 10 07:34:41 2010
New Revision: 1268

Log:
made the AuthSrv constructor exception-safe

Modified:
    trunk/src/bin/auth/auth_srv.cc

Modified: trunk/src/bin/auth/auth_srv.cc
==============================================================================
--- trunk/src/bin/auth/auth_srv.cc (original)
+++ trunk/src/bin/auth/auth_srv.cc Wed Mar 10 07:34:41 2010
@@ -71,20 +71,18 @@
 };
 
 AuthSrvImpl::AuthSrvImpl() {
+    // cur_datasrc_ is automatically initialized by the default constructor,
+    // effectively being an empty (sqlite) data source.  once ccsession is up
+    // the datasource will be set by the configuration setting
+    // (or the default one if none is set)
+
+    // add static data source
+    data_sources_.addDataSrc(ConstDataSrcPtr(new StaticDataSrc));
 }
 
-AuthSrv::AuthSrv() {
-    impl_ = new AuthSrvImpl;
-    // set empty (sqlite) data source, once ccsession is up
-    // the datasource will be set by the configuration setting
-    // (or the default one if none is set)
-    impl_->cur_datasrc_ = ConstDataSrcPtr();
-    // add static data source
-    impl_->data_sources_.addDataSrc(ConstDataSrcPtr(new StaticDataSrc));
-}
+AuthSrv::AuthSrv() : impl_(new AuthSrvImpl) {}
 
-AuthSrv::~AuthSrv()
-{
+AuthSrv::~AuthSrv() {
     delete impl_;
 }
 




More information about the bind10-changes mailing list