summaryrefslogtreecommitdiff
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:45:14 +0100
commit68086c59acd936d677dbc76473d34b484ec0b809 (patch)
treed98a20ae7582d4f949240ded391e3f0fc8df3159
parent3f69a82ceab665224dc39067f4d686e2be9c5eb5 (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 (cherry picked from commit 374c9af20d93029d999ca21beb2b989e0a428b98) Signed-off-by: Michael Stahl <mstahl@redhat.com>
-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);