Skip to content

Commit

Permalink
Guard against GC happening while string potentailly holds non-gc value.
Browse files Browse the repository at this point in the history
  • Loading branch information
hughsando committed Jan 20, 2014
1 parent 4adf107 commit b8f7815
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/String.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,10 @@ String String::__URLDecode() const

String &String::dup()
{
__s = GCStringDup(__s,length,&length);
// Take copy incase GCStringDup generates GC event
const HX_CHAR *oldString = __s;
__s = 0;
__s = GCStringDup(oldString,length,&length);
return *this;
}

Expand Down

0 comments on commit b8f7815

Please sign in to comment.