Skip to content

Commit

Permalink
Copy the reply msg before releasing the clientlock.
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/branches/MathCoreOSMC@4191 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Otto Tronarp committed Aug 31, 2009
1 parent 3685564 commit 44b6662
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Compiler/runtime/omc_communication_impl.cpp
Expand Up @@ -58,7 +58,7 @@ OmcCommunication_impl::OmcCommunication_impl()
char* OmcCommunication_impl::sendExpression( const char* expr )
{
WaitForSingleObject(clientlock,INFINITE); // Lock so no other tread can talk to omc.
//const char* retval = "";
char* retval = "";

// Signal to omc that message has arrived.

Expand All @@ -67,10 +67,10 @@ char* OmcCommunication_impl::sendExpression( const char* expr )

// Wait for omc to process message
while(WAIT_OBJECT_0 != WaitForSingleObject(omc_return_value_ready, INFINITE));
//retval = CORBA::string_dup(omc_reply_message); // dup the string here on this thread!
retval = CORBA::string_dup(omc_reply_message); // dup the string here on this thread!
ReleaseMutex(clientlock);

return CORBA::string_dup(omc_reply_message); // Has already been string_dup (prepared for CORBA)
return retval;//CORBA::string_dup(omc_reply_message); // Has already been string_dup (prepared for CORBA)
}

char* OmcCommunication_impl::sendClass( const char* expr )
Expand Down

0 comments on commit 44b6662

Please sign in to comment.