diff --git a/include/fc/ip.hpp b/include/fc/ip.hpp index 64b37c0..ddb7dbd 100644 --- a/include/fc/ip.hpp +++ b/include/fc/ip.hpp @@ -36,8 +36,8 @@ namespace fc { friend bool operator==( const endpoint& a, const endpoint& b ); private: - uint16_t _port; address _ip; + uint16_t _port; }; } } diff --git a/include/fc/shared_ptr.hpp b/include/fc/shared_ptr.hpp index ed85441..c8f6f9f 100644 --- a/include/fc/shared_ptr.hpp +++ b/include/fc/shared_ptr.hpp @@ -41,11 +41,11 @@ namespace fc { } ~shared_ptr() { if( _ptr ) { _ptr->release(); } } - shared_ptr& reset( T* v = 0 ) { + shared_ptr& reset( T* v = 0, bool inc = false ) { if( v == _ptr ) return *this; if( _ptr ) _ptr->release(); _ptr = v; - if( _ptr ) _ptr->retain(); + if( _ptr && inc ) _ptr->retain(); return *this; } diff --git a/src/stream.cpp b/src/stream.cpp index aa4812c..7da9d0d 100644 --- a/src/stream.cpp +++ b/src/stream.cpp @@ -17,11 +17,6 @@ namespace fc { cin_source( const cin_source& s ):_cin_thread(s._cin_thread){} std::streamsize read( char* s, std::streamsize n ) { - //if( !_cin_thread ) _cin_thread = new fc::thread("cin"); - - //if( _cin_thread != &fc::thread::current() ) { - // return _cin_thread->async( [=](){ return this->read( s, n ); } ).wait(); - // } int r = std::cin.readsome(s,n); if( std::cin && r <= 0 ) { std::cin.read( s, 1 );