[Debichem-commits] [SCM] massXpert mass spectrometry suite: debian packaging branch, debian, updated. upstream/3.2.0-1-g5564507
Filippo Rusconi (Debian Maintainer)
rusconi-debian at laposte.net
Thu Nov 24 21:27:16 UTC 2011
The following commit has been merged in the debian branch:
commit 606c7215096792218139a87579baca8e36d30058
Author: Filippo Rusconi (Debian Maintainer) <rusconi-debian at laposte.net>
Date: Mon Sep 21 15:36:38 2009 +0200
Bunch of both code tidying and memory leak fixes, thanks to Pere Constans suggesting cppcheck.
diff --git a/gui/compositionsDlg.cpp b/gui/compositionsDlg.cpp
index 865504d..6fab772 100644
--- a/gui/compositionsDlg.cpp
+++ b/gui/compositionsDlg.cpp
@@ -124,6 +124,9 @@ namespace massXpert
delete mpa_compositionProxyModel;
+ if (mpa_resultsString)
+ delete mpa_resultsString;
+
freeMonomerList();
}
diff --git a/gui/fragmentationDlg.cpp b/gui/fragmentationDlg.cpp
index 1a9169e..2732295 100644
--- a/gui/fragmentationDlg.cpp
+++ b/gui/fragmentationDlg.cpp
@@ -187,6 +187,9 @@ namespace massXpert
if (mpa_fragmenter)
delete mpa_fragmenter;
+
+ if (mpa_resultsString)
+ delete mpa_resultsString;
}
diff --git a/lib/calcOptions.cpp b/lib/calcOptions.cpp
index dff6ae8..ab21d0a 100644
--- a/lib/calcOptions.cpp
+++ b/lib/calcOptions.cpp
@@ -79,7 +79,8 @@ namespace massXpert
m_massType(other.m_massType),
m_capping(other.m_capping),
m_monomerEntities(other.m_monomerEntities),
- m_polymerEntities(other.m_polymerEntities)
+ m_polymerEntities(other.m_polymerEntities),
+ m_selectionType(other.m_selectionType)
{
}
@@ -109,6 +110,8 @@ namespace massXpert
other->m_coordinateList.empty();
other->setCoordinateList(m_coordinateList);
+
+ other->setSelectionType (m_selectionType);
}
@@ -129,6 +132,8 @@ namespace massXpert
m_coordinateList.empty();
setCoordinateList(other.m_coordinateList);
+
+ setSelectionType(other.m_selectionType);
}
diff --git a/lib/calcOptions.hpp b/lib/calcOptions.hpp
index 6c60fcf..527a7f5 100644
--- a/lib/calcOptions.hpp
+++ b/lib/calcOptions.hpp
@@ -80,8 +80,6 @@ namespace massXpert
CoordinateList m_coordinateList;
- SelectionType m_selectionType;
-
//! MXT_MASS_TYPE.
int m_massType;
@@ -93,6 +91,9 @@ namespace massXpert
//! MXT_POLYMER_CHEMENT.
int m_polymerEntities;
+
+ SelectionType m_selectionType;
+
public:
CalcOptions();
diff --git a/lib/chemEntVignette.cpp b/lib/chemEntVignette.cpp
index f05bc67..e1675ac 100644
--- a/lib/chemEntVignette.cpp
+++ b/lib/chemEntVignette.cpp
@@ -50,6 +50,9 @@ namespace massXpert
ChemEntVignette::ChemEntVignette(QGraphicsSvgItem *parent)
: QGraphicsSvgItem(parent)
{
+ mp_owner = 0;
+ mp_renderer = 0;
+
// qDebug() << __FILE__ << __LINE__
// << "ChemEntVignette()" <<(const void*) this;
}
@@ -60,6 +63,9 @@ namespace massXpert
QGraphicsSvgItem *parent)
: QGraphicsSvgItem(filePath, parent)
{
+ mp_owner = 0;
+ mp_renderer = 0;
+
// qDebug() << __FILE__ << __LINE__
// << "ChemEntVignette()" <<(const void*) this;
}
@@ -67,6 +73,10 @@ namespace massXpert
ChemEntVignette::~ChemEntVignette()
{
+ // We do not own these:
+ // mp_owner
+ //mp_renderer
+
// qDebug() << __FILE__ << __LINE__
// << "~ChemEntVignette()" <<(const void*) this;
diff --git a/lib/fragSpec.cpp b/lib/fragSpec.cpp
index 96a11ed..8861ae1 100644
--- a/lib/fragSpec.cpp
+++ b/lib/fragSpec.cpp
@@ -63,6 +63,8 @@ namespace massXpert
: PolChemDefEntity(polChemDef, name), Formula(formula),
m_fragEnd(fragEnd), m_comment(comment)
{
+ m_fragEnd = MXT_FRAG_END_NONE;
+
m_monomerContribution = 0;
}
@@ -77,9 +79,11 @@ namespace massXpert
\param formula Formula.
*/
FragSpec::FragSpec(const PolChemDef *polChemDef, QString name,
- QString formula)
+ QString formula)
: PolChemDefEntity(polChemDef, name), Formula(formula)
{
+ m_fragEnd = MXT_FRAG_END_NONE;
+
m_monomerContribution = 0;
}
diff --git a/lib/modifSpec.cpp b/lib/modifSpec.cpp
index 04c08fb..141df44 100644
--- a/lib/modifSpec.cpp
+++ b/lib/modifSpec.cpp
@@ -47,6 +47,12 @@
namespace massXpert
{
+ ModifSpec::ModifSpec()
+ {
+ m_action = 0;
+ }
+
+
void
ModifSpec::setName(const QString &name)
{
diff --git a/lib/modifSpec.hpp b/lib/modifSpec.hpp
index 1e7badc..a13e0bc 100644
--- a/lib/modifSpec.hpp
+++ b/lib/modifSpec.hpp
@@ -63,6 +63,8 @@ namespace massXpert
QString m_sound;
public:
+ ModifSpec();
+
void setName(const QString &);
const QString &name();
diff --git a/lib/oligomerList.cpp b/lib/oligomerList.cpp
index 5b0523b..3adc7d4 100644
--- a/lib/oligomerList.cpp
+++ b/lib/oligomerList.cpp
@@ -215,8 +215,11 @@ namespace massXpert
MassType localMassType = MXT_MASS_NONE;
if (massType == MXT_MASS_BOTH)
- return 0;
-
+ {
+ delete text;
+ return 0;
+ }
+
if (massType & MXT_MASS_NONE)
localMassType = m_massType;
else
diff --git a/lib/pkaPhPi.cpp b/lib/pkaPhPi.cpp
index 823af1a..cbb3287 100644
--- a/lib/pkaPhPi.cpp
+++ b/lib/pkaPhPi.cpp
@@ -57,6 +57,11 @@ namespace massXpert
{
m_ph = 7;
m_pi = 7;
+ m_positiveCharges = 0;
+ m_negativeCharges = 0;
+
+ mp_aborted = 0;
+ mp_progress = 0;
}
diff --git a/lib/polChemDef.cpp b/lib/polChemDef.cpp
index ca68d80..9303077 100644
--- a/lib/polChemDef.cpp
+++ b/lib/polChemDef.cpp
@@ -700,9 +700,8 @@ namespace massXpert
if (!chemEntVignetteRenderer->isValid())
{
- if(chemEntVignetteRenderer)
- delete chemEntVignetteRenderer;
-
+ delete chemEntVignetteRenderer;
+
return 0;
}
@@ -769,8 +768,7 @@ namespace massXpert
if (!chemEntVignetteRenderer->isValid())
{
- if(chemEntVignetteRenderer)
- delete chemEntVignetteRenderer;
+ delete chemEntVignetteRenderer;
return 0;
}
diff --git a/lib/polChemDefCatParser.cpp b/lib/polChemDefCatParser.cpp
index de46043..5fba9a3 100644
--- a/lib/polChemDefCatParser.cpp
+++ b/lib/polChemDefCatParser.cpp
@@ -51,6 +51,10 @@ namespace massXpert
PolChemDefCatParser::PolChemDefCatParser()
{
+ mp_configSettings = 0;
+ m_pendingMode = 0;
+ m_configSysUser = 0;
+
return ;
}
diff --git a/lib/polChemDefSpec.cpp b/lib/polChemDefSpec.cpp
index 5731f41..978b04d 100644
--- a/lib/polChemDefSpec.cpp
+++ b/lib/polChemDefSpec.cpp
@@ -96,17 +96,4 @@ namespace massXpert
}
- void
- PolChemDefSpec::setSource(int source)
- {
- m_source = source;
- }
-
-
- int
- PolChemDefSpec::source()
- {
- return m_source;
- }
-
} // namespace massXpert
diff --git a/lib/polChemDefSpec.hpp b/lib/polChemDefSpec.hpp
index ee94421..49537e8 100644
--- a/lib/polChemDefSpec.hpp
+++ b/lib/polChemDefSpec.hpp
@@ -56,12 +56,7 @@ namespace massXpert
// catalogue files, like
// '/usr/share/polyxmass/polchem-defs/protein.xml').
QString m_filePath;
-
- // Finally we want to be able to trace from where the data for this
- // polchemdefspec were read: system or user directory. Might be
- // either CONFIG_SYSTEM or CONFIG_USER.
- int m_source;
-
+
public:
PolChemDefSpec();
~PolChemDefSpec();
@@ -73,9 +68,6 @@ namespace massXpert
const QString &filePath() const;
QString dirPath();
-
- void setSource(int);
- int source();
};
} // namespace massXpert
--
massXpert mass spectrometry suite: debian packaging
More information about the Debichem-commits
mailing list