Hi. I have a problem with tokenizing UT_String.
While in if scope, tokenize works fine, but when it goes out of scope, array memory get trashed. I guess it because of UT_String tmp variable which gets deleted. Why is that happening? Btw, tokenize calling harden() inside, so the string is deep copied...
UT_ValArray<UT_String> *mimics_parmnames = new UT_ValArray<UT_String>();
mimics_asset = opdir->findOBJNode(args.argp('m'));
if (mimics_asset)
{
UT_String tmp;
tmp = args.argp('c');
tmp.tokenize(*mimics_parmnames);
if(mimics_parmnames->entries())
bake_mimics = true;
cout << "In: " << *mimics_parmnames << endl; // Everything is ok here
}
cout << "Out: " << *mimics_parmnames << endl; // Memory trashed here