Error with ram
Sznymo opened this issue · 5 comments
Error with ram still exists I checked and on Ubuntu and Arch
code:
import nigui
app.init()
var window = newWindow("Test")
window.width = 600.scaleToDpi
window.height = 400.scaleToDpi
var container = newLayoutContainer(Layout_Vertical)
window.add(container)
var button_remove = newButton("Button Test Remove")
var button_1 = newButton("Button Test 1")
var button_2 = newButton("Button Test 2")
var button_3 = newButton("Button Test 3")
var button_4 = newButton("Button Test 4")
var button_5 = newButton("Button Test 5")
var button_6 = newButton("Button Test 6")
var button_7 = newButton("Button Test 7")
var button_8 = newButton("Button Test 8")
var button_9 = newButton("Button Test 9")
var button_10 = newButton("Button Test 10")
container.add(button_remove)
container.add(button_1)
container.add(button_2)
container.add(button_3)
container.add(button_4)
container.add(button_5)
container.add(button_6)
container.add(button_7)
container.add(button_8)
container.add(button_9)
container.add(button_10)
button_remove.onClick = proc(event: ClickEvent) =
container.remove(button_1)
container.remove(button_2)
container.remove(button_3)
container.remove(button_4)
container.remove(button_5)
container.remove(button_6)
container.remove(button_7)
container.remove(button_8)
container.remove(button_9)
container.remove(button_10)
Strange, I can't reproduce the memory leak any more. Did you compile with the latest fix?
Btw, when you post code here, you can make it look better by adding as first line "```nim" and at the end "```".
I tested with this code:
import nigui
app.init()
var window = newWindow("Test")
window.width = 600.scaleToDpi
window.height = 600.scaleToDpi
var container = newLayoutContainer(Layout_Vertical)
window.add(container)
var button_remove = newButton("Test")
var button_1 = newButton("Button Test 1")
var button_2 = newButton("Button Test 2")
var button_3 = newButton("Button Test 3")
var button_4 = newButton("Button Test 4")
var button_5 = newButton("Button Test 5")
var button_6 = newButton("Button Test 6")
var button_7 = newButton("Button Test 7")
var button_8 = newButton("Button Test 8")
var button_9 = newButton("Button Test 9")
var button_10 = newButton("Button Test 10")
container.add(button_remove)
container.add(button_1)
container.add(button_2)
container.add(button_3)
container.add(button_4)
container.add(button_5)
container.add(button_6)
container.add(button_7)
container.add(button_8)
container.add(button_9)
container.add(button_10)
button_remove.onClick = proc(event: ClickEvent) =
container.remove(button_1)
container.remove(button_2)
container.remove(button_3)
container.remove(button_4)
container.remove(button_5)
container.remove(button_6)
container.remove(button_7)
container.remove(button_8)
container.remove(button_9)
container.remove(button_10)
container.add(button_1)
container.add(button_2)
container.add(button_3)
container.add(button_4)
container.add(button_5)
container.add(button_6)
container.add(button_7)
container.add(button_8)
container.add(button_9)
container.add(button_10)
let childs = container.childControls()
for child in childs:
var button = cast[Button](child)
echo button.text
window.show()
app.run()
yes with the latest version from github.
with the code you posted above I am getting a bunch of errors :
(test:9258): Gtk-CRITICAL **: 20:11:39.241: gtk_layout_move: assertion 'GTK_IS_WIDGET (child_widget)' failed
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
Error: execution of an external program failed: ''/home/user/Projekty/Menager/instalator/Tłumacz/test' '
I can't reproduce the SIGSEGV. I have tried Nim 1.6.12 and 2.0 RC1.
Which Nim version do you use? Do you compile for x86-64?
You can try a debug build, maybe the SIGSEGV shows then a line number.
I use nim 1.6.10, yes x64 . I tried it now with nim-1.6.12. same error :(
changing the gtk3 package to an older version of it didn't help either. the leak is still there :( but if it's only with me it's a small problem , come on 2 computers I saw the same error :/.
ps. I noticed that by using "choosenim devel", the leakage is much lower :)