desctruction des classes dans un set
salut,
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
TS* t=new TS(w);
t->setpayload(w);
TS* t1= new TS(w1);
t1->setpayload(w1);
set <TS> sec_ts;
set <TS> :: iterator it;
sec_ts.insert((TS)(*t));
sec_ts.insert((TS)(*t1));
for(it=sec_ts.begin();it!=sec_ts.end();it++)
{
printf("pid sec %x\n",(*it).getpid());
printf("countinuity counter sec %d\n",(*it).getcoutinuity_counter());
printf("table id sec %x\n",(*it).get_table_id());
printf("\n\n");
}
delete t;
delete t1; |
ce code compile parfaitement, il execute correctement la boucle for des printf
et enfin voilà ce qu'il m'affiche apres l'affichage des printf !!!!! :evilred:
:evilred:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| *** glibc detected *** ./r: free(): invalid next size (fast): 0x0804c088 ***
======= Backtrace: =========
/lib/i686/libc.so.6[0xb7dbddad]
/lib/i686/libc.so.6(__libc_free+0x83)[0xb7dbdf33]
/usr/lib/libstdc++.so.6(_ZdlPv+0x21)[0xb7f67d91]
./r[0x80491dd]
./r[0x8049202]
./r[0x8049252]
./r[0x804929a]
./r[0x80492c9]
./r[0x8049319]
./r[0x8048d22]
/lib/i686/libc.so.6(__libc_start_main+0xdc)[0xb7d6e75c]
./r(__gxx_personality_v0+0x6d)[0x8048881]
======= Memory map: ========
08048000-0804b000 r-xp 00000000 08:06 2333855 /home/sst/code/projet/source/r
0804b000-0804c000 rwxp 00002000 08:06 2333855 /home/sst/code/projet/source/r
0804c000-0806d000 rwxp 0804c000 00:00 0 [heap]
b7c00000-b7c21000 rwxp b7c00000 00:00 0
b7c21000-b7d00000 ---p b7c21000 00:00 0
b7d57000-b7d59000 rwxp b7d57000 00:00 0
b7d59000-b7e80000 r-xp 00000000 08:06 4131846 /lib/i686/libc-2.4.so
b7e80000-b7e81000 r-xp 00126000 08:06 4131846 /lib/i686/libc-2.4.so
b7e81000-b7e83000 rwxp 00127000 08:06 4131846 /lib/i686/libc-2.4.so
b7e83000-b7e86000 rwxp b7e83000 00:00 0
b7e86000-b7e90000 r-xp 00000000 08:06 4131899 /lib/libgcc_s-4.1.1.so.1
b7e90000-b7e91000 rwxp 0000a000 08:06 4131899 /lib/libgcc_s-4.1.1.so.1
b7e91000-b7eb4000 r-xp 00000000 08:06 4131848 /lib/i686/libm-2.4.so
b7eb4000-b7eb6000 rwxp 00023000 08:06 4131848 /lib/i686/libm-2.4.so
b7eb6000-b7f8f000 r-xp 00000000 08:06 4336217 /usr/lib/libstdc++.so.6.0.8
b7f8f000-b7f92000 r-xp 000d9000 08:06 4336217 /usr/lib/libstdc++.so.6.0.8
b7f92000-b7f94000 rwxp 000dc000 08:06 4336217 /usr/lib/libstdc++.so.6.0.8
b7f94000-b7f9a000 rwxp b7f94000 00:00 0
b7fac000-b7faf000 rwxp b7fac000 00:00 0
b7faf000-b7fc7000 r-xp 00000000 08:06 4131856 /lib/ld-2.4.so
b7fc7000-b7fc8000 r-xp 00017000 08:06 4131856 /lib/ld-2.4.so
b7fc8000-b7fc9000 rwxp 00018000 08:06 4131856 /lib/ld-2.4.so
bfef7000-bff0d000 rw-p bfef7000 00:00 0 [stack]
bfffe000-bffff000 r-xp bfffe000 00:00 0
Abandon |
:evilred:
ça c sur c un pb de memoir!!!
mais comment le résoudre!!! :king: