# HG changeset patch # User Teemu Piippo # Date 1409820485 -10800 # Node ID 7c50b61ad5b655978f0fe6976b0b3bb46ed229c2 # Parent f040f0fb37957cc2a4460bc73c97ac640833bb18 - fixed infinite recursion when loading logoed studs diff -r f040f0fb3795 -r 7c50b61ad5b6 src/ldDocument.cc --- a/src/ldDocument.cc Wed Sep 03 01:44:51 2014 +0300 +++ b/src/ldDocument.cc Thu Sep 04 11:48:05 2014 +0300 @@ -46,6 +46,7 @@ static QList g_allDocuments; static QList g_explicitDocuments; static LDDocumentPtr g_currentDocument; +static bool g_loadingLogoedStuds = false; const QStringList g_specialSubdirectories ({ "s", "48", "8" }); @@ -1461,13 +1462,14 @@ // void LoadLogoStuds() { - if (g_logoedStud and g_logoedStud2) + if (g_loadingLogoedStuds or (g_logoedStud and g_logoedStud2)) return; + g_loadingLogoedStuds = true; g_logoedStud = OpenDocument ("stud-logo.dat", true, true); g_logoedStud2 = OpenDocument ("stud2-logo.dat", true, true); - print (LDDocument::tr ("Logoed studs loaded.\n")); + g_loadingLogoedStuds = false; } // =============================================================================