This snippet (FileManager::Load) copies the bytes,
m_pchData points to, into
NullLoader's
data, so no crash anymore (I'm not sure if everything is correct, as written before I have no time, to work on it seriously).
if(ed && fileName == ed->GetFilename())
{
wxString s(ed->GetControl()->GetText());
int len = s.length() + 1;
NullLoader *nl = new NullLoader(file, (char*)wxStrcpy(new wxChar[len], s.c_str()), len * sizeof(wxChar));
return nl;
}
But you get a problem here:
If I see it correctly, FileLoader loads the content of the files into
data (byte by byte from disk), but the editors hold a widechar-string (at least in unicode-builds), so loading a file from disk or via fileloader does not lead to the same content automatically and parsing might fail (happens here for example).