misc/libopenalbridge/tester.c
author koda
Sun, 19 Jun 2011 12:34:54 +0200
changeset 5257 0bbdd47522b9
parent 3697 d5b30d6373fc
permissions -rw-r--r--
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.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3529
0e968ba12a84 memory management for openalbridge
koda
parents:
diff changeset
     1
#include <stdio.h>
0e968ba12a84 memory management for openalbridge
koda
parents:
diff changeset
     2
#include "openalbridge.h"
0e968ba12a84 memory management for openalbridge
koda
parents:
diff changeset
     3
0e968ba12a84 memory management for openalbridge
koda
parents:
diff changeset
     4
int main (int argc, int **argv) {
3697
d5b30d6373fc remove trailing spaces from end of line
koda
parents: 3529
diff changeset
     5
3529
0e968ba12a84 memory management for openalbridge
koda
parents:
diff changeset
     6
    openal_init();
3697
d5b30d6373fc remove trailing spaces from end of line
koda
parents: 3529
diff changeset
     7
3529
0e968ba12a84 memory management for openalbridge
koda
parents:
diff changeset
     8
    openal_close();
3697
d5b30d6373fc remove trailing spaces from end of line
koda
parents: 3529
diff changeset
     9
3529
0e968ba12a84 memory management for openalbridge
koda
parents:
diff changeset
    10
    return 0;
3697
d5b30d6373fc remove trailing spaces from end of line
koda
parents: 3529
diff changeset
    11
}