blob: a7cc7a6176564d1d48b5ad4031db5cda3f7ffa0e [file] [log] [blame]
Daniel Veillardc6d4a932002-09-12 15:00:57 +00001#!/usr/bin/python -u
2import sys
3import libxml2
4import StringIO
5
6# Memory debug specific
7libxml2.debugMemory(1)
8
9i = 0
10while i < 5000:
11 f = StringIO.StringIO("foobar")
12 buf = libxml2.inputBuffer(f)
13 i = i + 1
14
15del f
16del buf
17
18# Memory debug specific
19libxml2.cleanupParser()
20if libxml2.debugMemory(1) == 0:
21 print "OK"
22else:
23 print "Memory leak %d bytes" % (libxml2.debugMemory(1))
24 libxml2.dumpMemory()
25