Tag: cws_src680_dba24c User: fs Date: 2007-10-16 06:42:31+0000 Modified: dba/connectivity/source/inc/java/GlobalRef.hxx
Log: #i10000# File Changes: Directory: /dba/connectivity/source/inc/java/ ============================================= File [changed]: GlobalRef.hxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/inc/java/GlobalRef.hxx?r1=1.1.2.1&r2=1.1.2.2 Delta lines: +18 -11 --------------------- --- GlobalRef.hxx 2007-10-15 13:30:23+0000 1.1.2.1 +++ GlobalRef.hxx 2007-10-16 06:42:28+0000 1.1.2.2 @@ -4,9 +4,9 @@ * * $RCSfile: GlobalRef.hxx,v $ * - * $Revision: 1.1.2.1 $ + * $Revision: 1.1.2.2 $ * - * last change: $Author: fs $ $Date: 2007/10/15 13:30:23 $ + * last change: $Author: fs $ $Date: 2007/10/16 06:42:28 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -63,17 +63,19 @@ { } - explicit GlobalRef( const GlobalRef& _source ) + GlobalRef( const GlobalRef& _source ) :m_object( NULL ) { - set( _source.get() ); + *this = _source; } GlobalRef& operator=( const GlobalRef& _source ) { if ( &_source == this ) - return; - set( _source.get() ); + return *this; + + SDBThreadAttach t; + set( t.env(), _source.get() ); } ~GlobalRef() @@ -91,13 +93,18 @@ } } - void set( LocalRef< T >& object ) + void set( JNIEnv& _environment, T _object ) { if ( m_object != NULL ) - object.env().DeleteGlobalRef( m_object ); - m_object = object.release(); + _environment.DeleteGlobalRef( m_object ); + m_object = _object; if ( m_object ) - m_object = static_cast< T >( object.env().NewGlobalRef( m_object ) ); + m_object = static_cast< T >( _environment.NewGlobalRef( m_object ) ); + } + + void set( LocalRef< T >& _object ) + { + set( _object.env(), _object.release() ); } T get() const --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
