Sun, 07 Sep 2014 04:11:55 +0300
- fixed: due to a shared pointer called via reference called dismiss() in LDDocument::closeInitialFile, this could cause LDDocuments to delete themselves in setImplicit(true) as no shared pointers were left inside closeInitialFile to keep the refcount up.
- fixed: bad QMap iteration after erase in the gl compiler
how diabolic can bugs get? *shudder*
src/glCompiler.cc | file | annotate | diff | comparison | revisions | |
src/ldDocument.cc | file | annotate | diff | comparison | revisions |
--- a/src/glCompiler.cc Sun Sep 07 01:13:20 2014 +0300 +++ b/src/glCompiler.cc Sun Sep 07 04:11:55 2014 +0300 @@ -280,12 +280,18 @@ QVector<GLfloat> vbodata; - for (auto it = m_objectInfo.begin(); it != m_objectInfo.end(); ++it) + for (auto it = m_objectInfo.begin(); it != m_objectInfo.end();) { if (it.key() == null) + { it = m_objectInfo.erase (it); - elif (it.key().toStrongRef()->document() == CurrentDocument() and not it.key().toStrongRef()->isHidden()) + } + elif (it.key().toStrongRef()->document() == CurrentDocument() + and not it.key().toStrongRef()->isHidden()) + { vbodata += it->data[vbonum]; + ++it; + } } glBindBuffer (GL_ARRAY_BUFFER, m_vbo[vbonum]);
--- a/src/ldDocument.cc Sun Sep 07 01:13:20 2014 +0300 +++ b/src/ldDocument.cc Sun Sep 07 04:11:55 2014 +0300 @@ -173,6 +173,7 @@ if (m_isImplicit != a) { m_isImplicit = a; + print ("Setting implicity of %1 to %2\n", this, a ? "true" : "false"); if (a == false) { @@ -186,20 +187,10 @@ } else { + print ("Removing %1 from explicit documents...\n", this); g_explicitDocuments.removeOne (self().toStrongRef()); + print ("Removed %1", this); print ("Closed %1", name()); - int count = 0; - - for (LDObjectWeakPtr obj : g_allObjects) - { - if (obj == null) - continue; - - LDSubfilePtr ref = obj.toStrongRef().dynamicCast<LDSubfile>(); - - if (ref != null and ref->fileInfo() == self()) - count++; - } } if (g_win != null) @@ -702,7 +693,7 @@ for (LDDocumentWeakPtr doc : g_allDocuments) { - if (doc.toStrongRef()->name() == shortName) + if (doc != null and doc.toStrongRef()->name() == shortName) { documentToReplace = doc; break; @@ -1454,7 +1445,8 @@ not g_explicitDocuments[1]->name().isEmpty() and not g_explicitDocuments[0]->hasUnsavedChanges()) { - g_explicitDocuments[0]->dismiss(); + LDDocumentPtr filetoclose = g_explicitDocuments.first(); + filetoclose->dismiss(); } }