Bonjour,

J'ai un problème, j'ai une erreur lorsque j'essaye de libérer de la mémoire avec delete[] voici des parties de mon code :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Allocation dynamique de tableau a 2D
    double **matriceGlobale;
    matriceGlobale = new double* [tailleMatriceGlobale];
    for(int i =0; i<tailleMatriceGlobale; i++) matriceGlobale[i] = new double[tailleMatriceGlobale];

// Initialisation du tableau a 2D
    for(int i = 0; i<tailleMatriceGlobale; i++)
        for(int j=0; j<tailleMatriceGlobale; j++)
            matriceGlobale[i][j]=0;

// Calculs sur des éléments de ma matrice (tableau 2D)
...

// Libération de la mémoire occupée par le tableau 2D
    for (int i =0; i<tailleMatriceGlobale; i++) {
        delete[] matriceGlobale[i];
    }
    delete[] matriceGlobale;
Et c'est la que ça coince, j'obtient une erreur : Process returned -1073741819 (0xC0000005).


Quand j'essaye le debug, j'obtiens le message suivant :

Building to ensure sources are up-to-date
Build succeeded
Selecting target:
Debug
Adding source dir: C:\Documents and Settings\Administrator\Desktop\DF2D\DF2D\
Adding source dir: C:\Documents and Settings\Administrator\Desktop\DF2D\DF2D\
Adding file: bin\Debug\DF2D.exe
Starting debugger:
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb 6.7.50.20071127
Child process PID: 396
Error while mapping shared library sections:
Error while mapping shared library sections:
Program received signal SIGTRAP, Trace/breakpoint trap.
In ?? () ()

Je ne sais pas quoi faire ?
J'utilise codeBlocks 8.02 sous windowsXP (64bits).

Merci d'avance.