![](https://attach.openclonk.org/avatars/29-2030.png)
> GraphicsResource.ClearFonts(); // need to clear fonts since they keep FontLoader state, they will be reinitialized on time (#261)
I'm pretty sure separating ClearFonts out of Game.Clear was an optimization to reduce after-game load time, because loading fonts wasn't very fast for some reason. What is that "FontLoader state" that is not being kept?
C4FontLoader::Clear gets rid of the pVectorFonts, however CStdFonts created before keep a pointer on it and try to use it to render not-yet-encountered glyphs. #276 has instructions to reproduce this crash.
As for a better solution, what about splitting up C4FontLoader::Clear() into C4FontLoader::Clear() (clearing FontDefs) and C4FontLoader::ClearFonts() (clearing VectorFonts) and make Game.Clear only call FontLoader.Clear() so that the vector fonts which are still in use remain valid?
As for a better solution, what about splitting up C4FontLoader::Clear() into C4FontLoader::Clear() (clearing FontDefs) and C4FontLoader::ClearFonts() (clearing VectorFonts) and make Game.Clear only call FontLoader.Clear() so that the vector fonts which are still in use remain valid?
![](https://attach.openclonk.org/avatars/29-2030.png)
Alternatively, any data that is not cleared by a game clear (i.e., VectorFonts) could be moved out of C4Game into C4Application. This would make the whole process a bit more straightforward, as having some members cleared and some not can be confusing (and caused the crash in the first place).
![](https://attach.openclonk.org/avatars/24-4666.png)
Will your refactoring take care of the issue Sven raised? If so I wouldn't have to do it myself :)
after this "fix", nothing works.
there is some error like
there is some error like
[11:50:14] FATALER FEHLER: Fehler bei den Schriftdefinitionen
[11:50:14] FATALER FEHLER: Programm abgebrochen.(InitSystem)
carli@carli-laptop:~/openclonk/planet$ ./clonk
[15:54:45] Using XRandR version 1.3
Warning: ForEachFile with * (/home/carli/openclonk/planet/./*.c4p)
[15:54:46] No valid key file found.
[15:54:46] Command line:
[15:54:46] ""
[15:54:46] OpenClonk Beta (Cerulean)
[15:54:46] Version: 4.10.0.0 [002] Beta linux (ddea81d4af91)
[15:54:46] Fehler bei Grafikdatei CursorMedium: Datei nicht gefunden oder ungültig.
[15:54:46] No Gamepad found
[15:54:46] Fehler bei Grafikdatei CursorMedium: Datei nicht gefunden oder ungültig.
[15:54:46] Fehler bei Grafikdatei CursorMedium: Datei nicht gefunden oder ungültig.
[15:54:46] Fehler bei Grafikdatei CursorMedium: Datei nicht gefunden oder ungültig.
[15:54:46] FATALER FEHLER: Fehler bei den Schriftdefinitionen
[15:54:46] FATALER FEHLER: Programm abgebrochen.(InitSystem)
[15:54:46] Spiel deinitialisiert.
[15:54:46] Engine heruntergefahren.
Exitcode is 02.
![](https://attach.openclonk.org/avatars/24-4666.png)
Doesn't matter, your engine reports itself as build from a three week old source, I'm going to assume it didn't just pull a commit id out of a hat.
![](https://attach.openclonk.org/avatars/24-4666.png)
Pulling a commit id out of a hat would actually be easier - just alter the timestamp of the header - than having a current version which produces the error message.
![](https://attach.openclonk.org/avatars/29-2030.png)
[15:54:46] Version: 4.10.0.0 [002] Beta linux (ddea81d4af91)
Maybe you build to a different location? Or your build fails so the old engine is not replaced?
If in doubt, I usually delete all old engines and rebuild.
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill