Summary: | Crash after adding a new class [Grantlee::NodeList::render ] | ||
---|---|---|---|
Product: | [Applications] kdevelop | Reporter: | Daniel Vrátil <dvratil> |
Component: | general | Assignee: | kdevelop-bugs-null |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | afiestas, keks |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | 4.3.0 | ||
Platform: | Fedora RPMs | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/kdevplatform/d051357753220b47d1e5105850b3cd5038ec4b63 | Version Fixed In: | |
Sentry Crash Report: |
Description
Daniel Vrátil
2012-11-13 23:26:30 UTC
To be more clear: KDevelop crashed when I clicked "Finish" on the last page of the "New Class" wizard and respective .cpp and .h files were not created by KDevelop before the crash. Git commit d051357753220b47d1e5105850b3cd5038ec4b63 by Milian Wolff. Committed on 30/11/2012 at 16:47. Pushed by mwolff into branch 'tabbed-filetemplate-preview'. Create a singleton TemplateEngine that owns the Grantlee engine. Grantlee tries to unload plugins when the engine is unloaded which is hazardous and can lead to random crashes. This also makes more sense from the API point of view since the engine should not have a 1to1 relationship to a Grantle::Context. Instead, that should be a 1toN relationship. I have a bad feeling though: The ArchiveTemplateLoader, which get registered to the Engine, store a raw KArchiveDirectory* pointer which will probably be invalid as soon as the KArchive gets destroyed. This just begs to break down eventually, yet I do not see a way to unload a template loader from Grantlee. Probably we should refactor the ArchiveTemplateLoader to reflect its temporary nature. I think a RAII pattern should work, paired with a single ArchiveLoader in the engine that supports multiple archives registered by the RAII class. Anyhow even without the above this patch seems to resolve the crahes in the new tabbed file template preview. Many thanks to Olivier JG for investigating this issue! M +2 -0 language/CMakeLists.txt M +2 -4 language/codegen/templateclassgenerator.cpp M +1 -0 language/codegen/templateclassgenerator.h A +78 -0 language/codegen/templateengine.cpp [License: LGPL (v2+)] A +68 -0 language/codegen/templateengine.h [License: LGPL (v2+)] A +40 -0 language/codegen/templateengine_p.h [License: LGPL (v2+)] M +17 -50 language/codegen/templaterenderer.cpp M +2 -13 language/codegen/templaterenderer.h M +2 -1 plugins/filetemplates/templateclassassistant.cpp http://commits.kde.org/kdevplatform/d051357753220b47d1e5105850b3cd5038ec4b63 *** Bug 310880 has been marked as a duplicate of this bug. *** *** Bug 310501 has been marked as a duplicate of this bug. *** |