I know this is more like C++ problem, but I am using irrlicht data types, so I am posting this here in case there were some known bugs.
My class has constructor with stringw as an argument. At first I create pointer to my class, and then I use my constructor to allocate the data to my pointer.
Completely broken, weird, buggy, worse than nightmare code. Just restart your C++ tutorials and ask again later.
BTW: You rocmpiler should warn you about dangerous fragments in your code. What about turning on warning, or read those warnings?
At least if the text in the first posting was correct, it's not from the constructor. But extrapolating from the early attempts, I guess that the constructor uses an assignment from pointer to char array or something like that. So yeah, no further help possible, show the full code instead.
BTW: Yeah, this way to use the constructor is better. But make sure you clean up all the nodes. Otherwise, you could maybe use statically allocated objects (no new and pointer things, automatic memory cleanup, but limited lifetime).