AFAIK, addRoot is for memory allocated in GC heap, and addRange is for other types of memory, so you can't add non-gc memory as root (just a guess, see docs). I would allocate whole Args in GC heap and add is as root, yes, it would prevent collection until the root is removed. A better way would be to store Args in a linked list in the widget, this way it will be fully managed, and Args will live as long as the widget class instance references them without additional tinkering with GC.

Reply via email to