bonjour j'utilise tinyXml dans le cadre d'un projet et la taille mémoire ne cesse d'augmenter.
J'ai réussi à isoler le problème et j'ai des doutes sur la librairie tinyXML.
J'ai fait un petit programme de test :
appelé depuis le main qui est une boucle infinie :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 #define _CRT_SECURE_NO_DEPRECATE #include "stdlib.h" #include <string.h> #include "ticpp.h" #include "windows.h" #include <iostream> using namespace std; using namespace ticpp; void run() { Document myDocument; Element roorElement; roorElement.SetValue("Root"); char strName[16] = ""; char strAttribut[16] = ""; int i; int j; for( i=0; i<10; i++) { sprintf( strName, "Element%d", i); Element element; element.SetValue(strName); for( j=0; j<5; j++) { sprintf( strAttribut, "Attribut%d", j); element.SetAttribute( strAttribut, j); } roorElement.InsertEndChild( element); element.Clear(); } myDocument.InsertEndChild( roorElement); roorElement.Clear(); myDocument.SaveFile( "testTiny.xml"); myDocument.Clear(); }
Code:
1
2
3
4
5
6
7
8
9 void main() { bool b = true; while (b) { run(); Sleep( 1000); } }
Si quelqu'un a une idée ou a déjà rencontré ce problème, cela me serait très utile.
merci d'avance
PS : j'ai joint mon projet avec ce post
