mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
Fixed a segfault occurring when trying to open a non-QET file.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@1342 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -37,6 +37,7 @@ QString QETProject::integration_category_name = "import";
|
||||
*/
|
||||
QETProject::QETProject(int diagrams, QObject *parent) :
|
||||
QObject(parent),
|
||||
collection_(0),
|
||||
project_qet_version_(-1),
|
||||
read_only_(false)
|
||||
{
|
||||
@@ -63,6 +64,7 @@ QETProject::QETProject(int diagrams, QObject *parent) :
|
||||
*/
|
||||
QETProject::QETProject(const QString &path, QObject *parent) :
|
||||
QObject(parent),
|
||||
collection_(0),
|
||||
project_qet_version_(-1),
|
||||
read_only_(false)
|
||||
{
|
||||
@@ -97,6 +99,7 @@ QETProject::QETProject(const QString &path, QObject *parent) :
|
||||
*/
|
||||
QETProject::QETProject(const QDomElement &xml_element, QObject *parent) :
|
||||
QObject(parent),
|
||||
collection_(0),
|
||||
project_qet_version_(-1),
|
||||
read_only_(false)
|
||||
{
|
||||
@@ -116,7 +119,9 @@ QETProject::~QETProject() {
|
||||
|
||||
// supprime la collection
|
||||
// qDebug() << "Suppression de la collection du projet" << ((void *)this);
|
||||
delete collection_;
|
||||
if (collection_) {
|
||||
delete collection_;
|
||||
}
|
||||
// qDebug() << "Collection du projet" << ((void *)this) << "supprimee";
|
||||
|
||||
// qDebug() << diagrams_;
|
||||
|
||||
Reference in New Issue
Block a user