Csound Csound-dev Csound-tekno Search About

[Csnd] freeing an instance of Csound in a host application...

Date2009-08-21 10:05
FromRory Walsh
Subject[Csnd] freeing an instance of Csound in a host application...
I've a number of host applications that just don't want to quit when I
close the main GUI window. I have an OnClose() event that's called
when a user closes the application, in that event I have the following
code:

MyFrame::~MyFrame(){
  csound->Cleanup();
  csThread->Stop();
  csThread->Join();
 delete csThread;
 delete csound;	
}

It still hangs, is there anything else I can add to it?


Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2009-08-21 17:57
FromAndres Cabrera
Subject[Csnd] Re: freeing an instance of Csound in a host application...
I've done the cleanup after joining the threads, and I call csound->Destroy().

Cheers,
Andrés

On 8/21/09, Rory Walsh  wrote:
> I've a number of host applications that just don't want to quit when I
> close the main GUI window. I have an OnClose() event that's called
> when a user closes the application, in that event I have the following
> code:
>
> MyFrame::~MyFrame(){
>   csound->Cleanup();
>   csThread->Stop();
>   csThread->Join();
>  delete csThread;
>  delete csound;	
> }
>
> It still hangs, is there anything else I can add to it?
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
>


-- 


Andrés


Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2009-08-21 18:48
FromPINOT Francois
Subject[Csnd] Re: Re: freeing an instance of Csound in a host application...
I would use this:

  csThread->Stop();
  csThread->Join();
  csound->Cleanup;
  csound->Destroy;
  delete csThread;
  delete csound;

Francois Pinot

Andres Cabrera a écrit :
> I've done the cleanup after joining the threads, and I call csound->Destroy().
>
> Cheers,
> Andrés
>
> On 8/21/09, Rory Walsh  wrote:
>   
>> I've a number of host applications that just don't want to quit when I
>> close the main GUI window. I have an OnClose() event that's called
>> when a user closes the application, in that event I have the following
>> code:
>>
>> MyFrame::~MyFrame(){
>>   csound->Cleanup();
>>   csThread->Stop();
>>   csThread->Join();
>>  delete csThread;
>>  delete csound;	
>> }
>>
>> It still hangs, is there anything else I can add to it?
>>
>>
>> Send bugs reports to this list.
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>>     
>
>
>   



Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2009-08-23 17:50
FromRory Walsh
Subject[Csnd] Re: Re: Re: freeing an instance of Csound in a host application...
THanks guys, I'll try that out and let you know if it works..

2009/8/21 PINOT Francois :
> I would use this:
>
>  csThread->Stop();
>  csThread->Join();
>  csound->Cleanup;
>  csound->Destroy;
>  delete csThread;
>  delete csound;
>
> Francois Pinot
>
> Andres Cabrera a écrit :
>>
>> I've done the cleanup after joining the threads, and I call
>> csound->Destroy().
>>
>> Cheers,
>> Andrés
>>
>> On 8/21/09, Rory Walsh  wrote:
>>
>>>
>>> I've a number of host applications that just don't want to quit when I
>>> close the main GUI window. I have an OnClose() event that's called
>>> when a user closes the application, in that event I have the following
>>> code:
>>>
>>> MyFrame::~MyFrame(){
>>>  csound->Cleanup();
>>>  csThread->Stop();
>>>  csThread->Join();
>>>  delete csThread;
>>>  delete csound;
>>> }
>>>
>>> It still hangs, is there anything else I can add to it?
>>>
>>>
>>> Send bugs reports to this list.
>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>>> csound"
>>>
>>>
>>
>>
>>
>
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
>


Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2009-08-23 19:28
FromRory Walsh
Subject[Csnd] Re: Re: Re: freeing an instance of Csound in a host application...
Destroy() is not a member of the Csound class, it's called in the
destructor of the Csound class. Either way your advise seems to have
done the trick, I shouldn't have been cleaning up before stopping the
thread. Thanks again,
Rory.


2009/8/23 Rory Walsh :
> THanks guys, I'll try that out and let you know if it works..
>
> 2009/8/21 PINOT Francois :
>> I would use this:
>>
>>  csThread->Stop();
>>  csThread->Join();
>>  csound->Cleanup;
>>  csound->Destroy;
>>  delete csThread;
>>  delete csound;
>>
>> Francois Pinot
>>
>> Andres Cabrera a écrit :
>>>
>>> I've done the cleanup after joining the threads, and I call
>>> csound->Destroy().
>>>
>>> Cheers,
>>> Andrés
>>>
>>> On 8/21/09, Rory Walsh  wrote:
>>>
>>>>
>>>> I've a number of host applications that just don't want to quit when I
>>>> close the main GUI window. I have an OnClose() event that's called
>>>> when a user closes the application, in that event I have the following
>>>> code:
>>>>
>>>> MyFrame::~MyFrame(){
>>>>  csound->Cleanup();
>>>>  csThread->Stop();
>>>>  csThread->Join();
>>>>  delete csThread;
>>>>  delete csound;
>>>> }
>>>>
>>>> It still hangs, is there anything else I can add to it?
>>>>
>>>>
>>>> Send bugs reports to this list.
>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>>>> csound"
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>>
>> Send bugs reports to this list.
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>


Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"