From 374c9af20d93029d999ca21beb2b989e0a428b98 Mon Sep 17 00:00:00 2001 From: Ariel Constenla-Haile Date: Mon, 16 Jan 2012 19:27:22 +0000 Subject: i118798 - Fix Pyuno dead-lock MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes fdo#57569, thanks to Miklós Prisznyák for the hint. git-svn-id: https://svn-master.apache.org/repos/asf/incubator/ooo/trunk@1232123 13f79535-47bb-0310-9956-ffa450edef68 --- pyuno/source/module/pyuno_adapter.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'pyuno') diff --git a/pyuno/source/module/pyuno_adapter.cxx b/pyuno/source/module/pyuno_adapter.cxx index 2be265fc3945..08b76ad78a25 100644 --- a/pyuno/source/module/pyuno_adapter.cxx +++ b/pyuno/source/module/pyuno_adapter.cxx @@ -359,20 +359,20 @@ Any Adapter::invoke( const OUString &aFunctionName, void Adapter::setValue( const OUString & aPropertyName, const Any & value ) throw( UnknownPropertyException, CannotConvertException, InvocationTargetException,RuntimeException) { + if( !hasProperty( aPropertyName ) ) + { + OUStringBuffer buf; + buf.appendAscii( "pyuno::Adapater: Property " ).append( aPropertyName ); + buf.appendAscii( " is unknown." ); + throw UnknownPropertyException( buf.makeStringAndClear(), Reference< XInterface > () ); + } + PyThreadAttach guard( mInterpreter ); try { Runtime runtime; PyRef obj = runtime.any2PyObject( value ); - if( !hasProperty( aPropertyName ) ) - { - OUStringBuffer buf; - buf.appendAscii( "pyuno::Adapater: Property " ).append( aPropertyName ); - buf.appendAscii( " is unknown." ); - throw UnknownPropertyException( buf.makeStringAndClear(), Reference< XInterface > () ); - } - PyObject_SetAttrString( mWrappedObject.get(), (char*)TO_ASCII(aPropertyName), obj.get() ); raiseInvocationTargetExceptionWhenNeeded( runtime); -- cgit v1.2.3