gardon
12-18-2007, 04:32 PM
I have an IDirectMusicPerformance8* object. If I pass that object into a function, and do the following, do I have to call release on the new pointer?:
void SetPerformance( IDirectMusicPerformance8 * performer )
{
IDirectMusicPerformance8* newPerformer = performer;
}
At the end of the code, I would have the original variable 'performer' that was passed in to the function stored elsewhere. I would call release on it, but would I also have to call release on the new variable I created and assigned to that outside variable?
Would I do the following?
newPerformer->Release();
performer->Release();
Or do I just set the 'newPerformer' variable I created in the function to NULL, and only release the first instance?
It's been a while since I've programmed...
Thanks in advance.
void SetPerformance( IDirectMusicPerformance8 * performer )
{
IDirectMusicPerformance8* newPerformer = performer;
}
At the end of the code, I would have the original variable 'performer' that was passed in to the function stored elsewhere. I would call release on it, but would I also have to call release on the new variable I created and assigned to that outside variable?
Would I do the following?
newPerformer->Release();
performer->Release();
Or do I just set the 'newPerformer' variable I created in the function to NULL, and only release the first instance?
It's been a while since I've programmed...
Thanks in advance.