Hi. I have a complex object declared in shared memory:
type
SubObj = object
idata: int
fdata: float
sdata: string
MyObj = object
title: string
data: SubObj
var lock: Lock
var shrObj {.guard: lock.}: ptr MyObj
shrObj = cast[ptr MyObj](allocShared0(sizeof(MyObj)))
shrObj.title = "abc"
shrObj.data.idata = 123
shrObj.data.fdata = 0.01
shrObj.data.sdata = "text data..."
#GCunref(shrObj.title)
#GCunref(shrObj.data.sdata)
dealloc(shrObj)
dealloc function will excepted (alloc.nim:399
c.prev.next = c.next
). What I'm doing wrong? Also, is it necessary to call a function GCunref? (I
saw it in manual)