Re: Destructor needed
Re: Destructor needed
- Subject: Re: Destructor needed
- From: William Stewart <email@hidden>
- Date: Mon, 26 Feb 2007 12:05:06 -0800
On 24/02/2007, at 2:39 PM, Adam Stark wrote:
Hi,
I am having problems with a plug-in. It works absolutely fine but
occasionally it crashes, particularly when quitting a program or
removing the effect, and i am trying to track down the culprit and
so I have some questions (we will call my effect 'Effect' for this
email...):
- I have used another class, created an object of it in the
effect.cpp/effect.h files:
Classtype instance;
Do I have to create a destructor for the EffectKernel class and
destroy this?
- If I create an array such as:
float *array;
and then in my constructor add:
array = new float[512]l
then do I have to destroy this in a destructor to avoid problems?
Yes - otherwise you will leak that memory. Also, where are you
getting 512 from? If that is what you expect to have to allocate -
then you should use the number return by the maximum frames per slice
method in AUBase::GetMaxFramesPerSlice()
I'm sorry if these are basic programming questions but I wanted to
ask the question in relation to audio units.
There are some good introductory books to C++ programming -
"Effective C++" was always one of my favourites.
Bill
I'd be very grateful for any help,
Thanks,
Adam
_________________________________________________________________
MSN Hotmail is evolving – check out the new Windows Live Mail
http://ideas.live.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________
__
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden