Csound Csound-dev Csound-tekno Search About

Re: [Cs-dev] CsoundPython.cpp

Date2006-05-11 21:10
FromVictor Lazzarini
SubjectRe: [Cs-dev] CsoundPython.cpp
It looks like destroying the old instance just before the
function returns is the fix, as Istvan said. It seems to be
the
right find to do and is working here.

Victor

>
> The reason is we want the csound instance created in the
> csnd Python extension module to replace the one created by
> csound5gui. If you can find a way to plug the csound
> instance created in csound5gui into Python so it gets its
> proper Python wrapper let me know.
>
> Regards,
> Mike
>
> -----Original Message-----
> >From: Victor Lazzarini 
> >Sent: May 11, 2006 3:11 PM
> >To: csound-devel@lists.sourceforge.net
> >Subject: [Cs-dev] CsoundPython.cpp
> >
> >Looking again at CsoundPython.cpp, it seems right that
> there >was a memory access exception with csound5GUI. This
> bit of >code, which is responsible for it, is suspect:
> >
> > csoundDestroy(csound);
> > csound = cppSound->getCsound();
> > csoundSetHostData(csound, csoundGetHostData(*csound_));
> > csoundSetMessageCallback(csound,
> >
> >&CsoundGUIConsole::messageCallback_Thread);
> >
> >It appears that by destroy 'csound' we destroy *csound_,
> >which then
> >causes the csoundSet...() API calls to fail.
> >
> >I don't really understand the code and the reasons why
> you >have to
> >create a new instance and destroy the old one. It appears
> >that is
> >because you want the derived object rather than the base,
> >which is
> >fine, but it is crashing here.
> >
> >If we on the other hand do not destroy the old instance,
> >then it's
> >OK. There is no crash. I don't really want to go
> modifying >code that
> >I don't fully understand, so I'll leave it up to the
> authors >to fix it,
> >now that we know where the problem lies.
> >
> >Best regards,
> >
> >Victor
> >
> >
> >-------------------------------------------------------
> >Using Tomcat but need to do more? Need to support web
> services, security? >Get stuff done quickly with
> pre-integrated technology to make your job easier
> >Download IBM WebSphere Application Server v.1.0.1 based
> on Apache Geronimo
> >http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=26
> 3057&dat=121642
> >_______________________________________________
> >Csound-devel mailing list
> >Csound-devel@lists.sourceforge.net
> >https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
>
>
>
> -------------------------------------------------------
> Using Tomcat but need to do more? Need to support web
> services, security? Get stuff done quickly with
> pre-integrated technology to make your job easier Download
> IBM WebSphere Application Server v.1.0.1 based on Apache
> Geronimo
> http://sel.as-us.falkag.net/sel?
cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net