summaryrefslogtreecommitdiff
path: root/pyuno
diff options
context:
space:
mode:
authorAriel Constenla-Haile <arielch@apache.org>2012-01-16 19:27:22 +0000
committerMichael Stahl <mstahl@redhat.com>2012-12-11 19:40:50 +0100
commit374c9af20d93029d999ca21beb2b989e0a428b98 (patch)
tree0e3e62c7796d5e706a753237dd2e546d5a140ac4 /pyuno
parent6531960ad606f52ec84956c695b1fd40fda1bb35 (diff)
i118798 - Fix Pyuno dead-lock
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
Diffstat (limited to 'pyuno')
-rw-r--r--pyuno/source/module/pyuno_adapter.cxx16
1 files changed, 8 insertions, 8 deletions
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);