From: mkr Date: Wed, 9 Jul 2008 08:35:23 +0000 (+0000) Subject: Fix for bug IPAL20089 : Mandriva 2007-2008 porting: impossible to save/dump the study. X-Git-Tag: RELIQUAT_4x_25102008 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Ftags%2FV4_1_0_maintainance_20080805;p=modules%2Fsuperv.git Fix for bug IPAL20089 : Mandriva 2007-2008 porting: impossible to save/dump the study. --- diff --git a/src/Supervision/SuperV_Impl.cxx b/src/Supervision/SuperV_Impl.cxx index 510d76c..bb67872 100644 --- a/src/Supervision/SuperV_Impl.cxx +++ b/src/Supervision/SuperV_Impl.cxx @@ -96,7 +96,6 @@ Engines::TMPFile * SuperV_Impl::DumpPython( CORBA::Object_ptr theStudy , bool success = true ; SALOMEDS::Study_var aStudy = SALOMEDS::Study::_narrow( theStudy ) ; // typedef sequence TMPFile; - Engines::TMPFile_var aStreamPythonvar ; SALOMEDS::SObject_var aStudyObject ; SALOMEDS::SObject_var aStudyObjectValue ; SUPERV::StreamGraph_var aStreamGraph ; @@ -236,9 +235,14 @@ Engines::TMPFile * SuperV_Impl::DumpPython( CORBA::Object_ptr theStudy , aStringRebuildData += " sg.updateObjBrowser( 1 )\n" ; aStringRebuildData += " return 1\n" ; aStringGraph += aStringRebuildData ; + int aLen = strlen( aStringGraph.c_str() ) ; - CORBA::Octet * anOctetBuffer = (CORBA::Octet * ) aStringGraph.c_str() ; - aStreamPythonvar = new Engines::TMPFile ( aLen+1 , aLen+1 , anOctetBuffer ,1 ) ; + unsigned char* aBuffer = new unsigned char[aLen+1]; + strcpy((char*)aBuffer, aStringGraph.c_str()); + + CORBA::Octet* anOctetBuffer = (CORBA::Octet*)aBuffer; + Engines::TMPFile_var aStreamPythonvar = new Engines::TMPFile ( aLen+1 , aLen+1 , anOctetBuffer ,1 ) ; + endService( "Super_Impl::DumpPython" ); return aStreamPythonvar._retn() ; }