Re: Crash writing and reading back class instance address to void*

2014-08-18 Thread Remi Thebault via Digitalmars-d-learn
Classes are reference types. You take reference of local reference (it's address on stack). Use just cast(void*)t Thank you!

Re: Crash writing and reading back class instance address to void*

2014-08-18 Thread FreeSlave via Digitalmars-d-learn
On Monday, 18 August 2014 at 10:07:30 UTC, Remi Thebault wrote: Hi Starting to use GtkD TreeModel, I write an instance of an abstract class to TreeIter.userData. When reading back the void pointer and casting to my abstract class leads to crash when instance is used (Task is the abstract cl

Crash writing and reading back class instance address to void*

2014-08-18 Thread Remi Thebault via Digitalmars-d-learn
Hi Starting to use GtkD TreeModel, I write an instance of an abstract class to TreeIter.userData. When reading back the void pointer and casting to my abstract class leads to crash when instance is used (Task is the abstract class): int fillIter(TreeIter iter, Task t) {