0
0

This is probably a stupid question, but when using the C API, is it safe to pass a null pointer to functions that expect an object, or do I have to check the pointer’s value before calling the function?

My current code does the following:
[code:3lvsc5l1]b5Music::~b5Music ()
{
FMOD_Channel_Stop(this->pImpl->Channel);
FMOD_Sound_Release(this->pImpl->Handle);
}[/code:3lvsc5l1]

…but I’m not sure if that’s entirely safe (pImpl->Channel may be null if the music object has never been played). I haven’t had FMOD crash yet by passing a null parameter, but that just may be dumb luck. I want to make sure.

  • You must to post comments
0
0

Okay, thanks! I just wanted to make sure; I remember being able to crash FMOD 3 by passing NULL to a function that expects an object.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.