And this is the diff when I cast to Surface instead of RootRef:
@nuc /tmp/salewski/.cache/nim $ diff drawingarea_d/ crash/
diff drawingarea_d/drawingarea.json crash/drawingarea.json
4,9c4
< "compile": [
< [
<
"/tmp/salewski/.cache/nim/drawingarea_d/@m..@s..@shome@[email protected]@spkgs@[email protected]@[email protected]",
< "gcc -c -w -fmax-errors=3 -I/home/salewski/Nim/lib -I/tmp/hhh -o
/tmp/salewski/.cache/nim/drawingarea_d/@m..@s..@shome@[email protected]@spkgs@[email protected]@[email protected]
/tmp/salewski/.cache/nim/drawingarea_d/@m..@s..@shome@[email protected]@spkgs@[email protected]@[email protected]"
< ]
< ],
---
> "compile": [],
diff
drawingarea_d/@m..@s..@shome@[email protected]@spkgs@[email protected]@[email protected]
crash/@m..@s..@shome@[email protected]@spkgs@[email protected]@[email protected]
40a41
> typedef struct RootObj RootObj;
111,112c112
< N_LIB_PRIVATE N_NIMCALL(void,
GC_unref_OOZOOZhomeZsalewskiZOnimbleZpkgsZgintro4535v48O57O50ZgintroZcairo_720)(tyObject_SurfacecolonObjectType___u9boMgJzUmcT9bFvEdAxcViw*
x);
< N_LIB_PRIVATE N_NIMCALL(void,
eqdestroy__OOZOOZhomeZsalewskiZOnimbleZpkgsZgintro4535v48O57O50ZgintroZcairo_143)(tyObject_SurfacecolonObjectType___u9boMgJzUmcT9bFvEdAxcViw**
dest);
---
> N_LIB_PRIVATE N_NIMCALL(void,
GC_unref_OOZOOZhomeZsalewskiZOnimbleZpkgsZgintro4535v48O57O50ZgintroZgobject_160)(RootObj*
x);
556,569d555
< N_LIB_PRIVATE N_NIMCALL(void,
GC_unref_OOZOOZhomeZsalewskiZOnimbleZpkgsZgintro4535v48O57O50ZgintroZcairo_720)(tyObject_SurfacecolonObjectType___u9boMgJzUmcT9bFvEdAxcViw*
x) {
< tyObject_SurfacecolonObjectType___u9boMgJzUmcT9bFvEdAxcViw* y;
< NIM_BOOL* nimErr_;
< nimfr_("GC_unref", "/home/salewski/Nim/lib/system/arc.nim");
< {nimErr_ = nimErrorFlag();
< y = (tyObject_SurfacecolonObjectType___u9boMgJzUmcT9bFvEdAxcViw*)0;
< nimln_(210, "/home/salewski/Nim/lib/system/arc.nim");
< y = x;
< nimln_(211, "/home/salewski/Nim/lib/system/arc.nim");
<
eqdestroy__OOZOOZhomeZsalewskiZOnimbleZpkgsZgintro4535v48O57O50ZgintroZcairo_143(&y);
< if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
< }BeforeRet_: ;
< popFrame();
< }
573c559
<
GC_unref_OOZOOZhomeZsalewskiZOnimbleZpkgsZgintro4535v48O57O50ZgintroZcairo_720(((tyObject_SurfacecolonObjectType___u9boMgJzUmcT9bFvEdAxcViw*)
(o)));
---
>
GC_unref_OOZOOZhomeZsalewskiZOnimbleZpkgsZgintro4535v48O57O50ZgintroZgobject_160(((RootObj*)
(o)));
Binary files
drawingarea_d/@m..@s..@shome@[email protected]@spkgs@[email protected]@[email protected]
and
crash/@m..@s..@shome@[email protected]@spkgs@[email protected]@[email protected]
differ
Run
I also did a small test program, but for that the parameter type of GC_unref()
made no difference, it was working always fine.