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.
glob:CMakeCache.txt
glob:CMakeFiles
glob:moc_*.cxx
glob:qrc_*.cxx
glob:*.o
glob:Makefile
glob:bin
glob:*.hi
glob:*.*~
glob:*.core
glob:hedgewars/config.inc
glob:cmake_install.cmake
glob:QTfrontend/hwconsts.cpp
glob:CPackConfig.cmake
glob:CPackSourceConfig.cmake
glob:tools/cmake_uninstall.cmake
glob:install_manifest.txt
glob:.DS_Store
glob:*.swp
glob:*.orig
glob:*.diff
glob:vittorio.*
glob:project_files/HedgewarsMobile/Data/
glob:project_files/HedgewarsMobile/build/
glob:gameServer/dist/
glob:misc/libtremor/Xcode/build/
glob:misc/liblua/Xcode/build/
glob:misc/libfreetype/Xcode/build/
glob:misc/libfreetype/Xcode-iPhoneOS/build/
glob:moc_*.cxx_parameters
relre:^release\/
glob:*.log
glob:*.cmd
glob:*.diff
glob:*.patch
glob:*.orig
glob:*.bak
glob:*.rej