sound_enabled = true;
music_enabled = true;
} catch(std::exception& e) {
- if(context != NULL)
+ if(context != NULL) {
alcDestroyContext(context);
- context = NULL;
- if(device != NULL)
+ context = NULL;
+ }
+ if(device != NULL) {
alcCloseDevice(device);
- device = NULL;
+ device = NULL;
+ }
log_warning << "Couldn't initialize audio device: " << e.what() << std::endl;
print_openal_version();
}
if(context != NULL) {
alcDestroyContext(context);
+ context = NULL;
}
if(device != NULL) {
alcCloseDevice(device);
+ device = NULL;
}
}
} else {
if(music_source) {
delete music_source;
- music_source = 0;
+ music_source = NULL;
}
}
}