I'd highly recommend avoiding those CUtl things in that context. Just use
regular STL unless you're dealing with a Valve interface that demands something
else. STL is much more robust and easier to debug.
At 2006/05/04 08:58 AM, Jay C. wrote:
>I'm trying (unsuccessfully) to use some of the VSTBLIB functions provided in
>strtools.h
>
>I have the following code, which when run in the IDE gives me a user
>breakpoint in free.c:101 - HeapFree.
>When I run it compiled it crashes SRCDS.
>
>---------------------------------------------
>
>CUtlVector<char*, CUtlMemory<char*> > outStrings;
>const char *sToDo = "gren, pans, heli";
>Q_SplitString( sToDo, ",", outStrings );
>char sTmp[25] = "";
>int x = 0;
>for ( x = 0; x < outStrings.Count(); x++ )
>{
> Q_StrSubst( outStrings[x], " ", "", sTmp, 25, true );
> META_LOG( g_PLAPI, "String:'%s'", sTmp );
>}
>Q_strcpy( sTmp, "" );
>outStrings.PurgeAndDeleteElements();
>return;
>
>---------------------------------------------
>
>It stops when I remove PurgeandDeleteElements() but then I'm causing memory
>leaks :\
>
>Has anyone else had this problem or anything related?
>
>Thanks
>- Jason Croghan
>
>
>_______________________________________________
>To unsubscribe, edit your list preferences, or view the list archives, please
>visit:
>http://list.valvesoftware.com/mailman/listinfo/hlcoders
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders