passing by reference... my darkest enemy
actual reason below:
In your case (without reference) the compiler generates a temporary object (int) for the first argument of your MyApplication constructor. You pass this temporary int to QApplication’s constructor (with int reference), which saves the address of this reference. Once your MyApplication constructor is done the temporary int is destroyed but QApplication still has its address.
LIBRARY "openalbridge"
EXPORTS
openal_init
openal_close
openal_ready
openal_loadfile
openal_playsound
openal_pausesound
openal_stopsound
openal_playsound_loop
openal_stopsound_free
openal_freesound
openal_toggleloop
openal_setvolume
openal_setglobalvolume
openal_togglemute
openal_fade
openal_fadein
openal_fadeout