mirror of https://gitlab.com/nakst/essence
fix text editor crash
This commit is contained in:
parent
1781b060a7
commit
8a3bd28c92
|
@ -406,7 +406,9 @@ void ProcessApplicationMessage(EsMessage *message) {
|
||||||
void _start() {
|
void _start() {
|
||||||
_init();
|
_init();
|
||||||
|
|
||||||
EsINIState state = { (char *) EsFileReadAll(EsLiteral(SETTINGS_FILE), &state.bytes) };
|
size_t settingsFileBytes = 0;
|
||||||
|
char *settingsFile = (char *) EsFileReadAll(EsLiteral(SETTINGS_FILE), &settingsFileBytes);
|
||||||
|
EsINIState state = { .buffer = settingsFile, .bytes = settingsFileBytes };
|
||||||
|
|
||||||
while (EsINIParse(&state)) {
|
while (EsINIParse(&state)) {
|
||||||
if (0 == EsStringCompareRaw(state.section, state.sectionBytes, EsLiteral("general"))) {
|
if (0 == EsStringCompareRaw(state.section, state.sectionBytes, EsLiteral("general"))) {
|
||||||
|
@ -416,7 +418,7 @@ void _start() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EsHeapFree(state.buffer);
|
EsHeapFree(settingsFile);
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
ProcessApplicationMessage(EsMessageReceive());
|
ProcessApplicationMessage(EsMessageReceive());
|
||||||
|
|
Loading…
Reference in New Issue