use lqtL_pcall in common files
[lqt.git] / test / mm.lua
blob139517aa3644534fc91ff7bf5b7dab62b2691ef9
1 #!/usr/bin/lua
3 require'qtcore'
5 qapp = QCoreApplication.new_local(1+select("#", ...), {arg[0], ...})
7 local N = 1
8 local qo = nil
9 local del = QObject.delete
10 for i = 1, 10*N do
11 qo = QObject.new_local(qo)
12 print('created QObject', qo);
13 qo.delete = function(...) del(...) print('deleting', ...) end
14 qo.__gc = function(...) del(...) print('deleting', ...) end
15 end
17 -- [[
18 local t = {}
19 for i = 1, 10*N do
20 table.insert(t, qo)
21 print("getting parent", qo)
22 qo = qo:parent()
23 end
24 --]]
27 qo=nil
28 print('collecting')
29 collectgarbage("collect")
30 collectgarbage("collect")
31 print('processing')
32 qapp.processEvents()
33 t=nil
34 print('collecting')
35 collectgarbage("collect")
36 print('processing')
37 qapp.processEvents()
38 print('collecting')
39 collectgarbage("collect")