OSDN Git Service

shared_handle.hpp バグってたわ。直したわ…
authorMyun2 <myun2@nwhite.info>
Thu, 17 May 2012 16:30:31 +0000 (01:30 +0900)
committerMyun2 <myun2@nwhite.info>
Thu, 17 May 2012 16:30:31 +0000 (01:30 +0900)
roast/include/roast/io/handle_manage.hpp
roast/include/roast/io/shared_handle.hpp

index 30da327..40b763c 100644 (file)
@@ -35,7 +35,8 @@ namespace roast
                
        protected:
                //      Handler
-               _HandlerType m_handle;
+               //_HandlerType m_handle;
+               shared_handle<_Impl> m_handle;
        
        protected:
                //      Handler Check
@@ -57,11 +58,14 @@ namespace roast
                
                //      Close
                void close(){
+                       /*      2012/05/18 myun2  Close by shared_handle.
+                       
                        if ( m_handle != _Impl::invalid_handle )
                        {
                                _Impl::close(m_handle);
                                m_handle = _Impl::invalid_handle;
                        }
+                       */
                }
                
                ////////////////////////////////////////////////////
index 80b6476..54582bb 100644 (file)
@@ -50,6 +50,7 @@ namespace roast
                holder *m_pholder;
        public:
                shared_handle(const handler_type& hndl) : m_pholder(new holder(hndl)){ m_pholder->up(); }
+               shared_handle(const shared_handle& from) : m_pholder(from.m_pholder){ m_pholder->up(); }
                virtual ~shared_handle(){ m_pholder->down(); }
 
                /////////////////////////////////////////////////////