]> Git trees. - libqmvoc.git/commitdiff
Pluggin memleaks and now using qDeleteAll
authorCarsten Niehaus <cniehaus@gmx.de>
Thu, 19 Oct 2006 16:28:45 +0000 (16:28 +0000)
committerCarsten Niehaus <cniehaus@gmx.de>
Thu, 19 Oct 2006 16:28:45 +0000 (16:28 +0000)
svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=597220

libscience/chemicaldataobject.cpp
libscience/element.cpp
libscience/isotope.cpp
libscience/isotope.h
libscience/spectrum.cpp
libscience/spectrum.h

index cde1f727546817fd04e0b5874cb9db31ae3ab884..9c9e6d302e98e67a203c72957e949d14219effe5 100644 (file)
@@ -28,9 +28,16 @@ class ChemicalDataObjectPrivate
                QVariant m_errorValue;
                ChemicalDataObject::BlueObelisk m_type;
                ChemicalDataObject::BlueObeliskUnit m_unit;
+
+    ~ChemicalDataObjectPrivate();
 };
 
-ChemicalDataObject::ChemicalDataObject( const QVariant& v, BlueObelisk type, const QVariant& errorValue ) : d(new ChemicalDataObjectPrivate()) 
+ChemicalDataObjectPrivate::~ChemicalDataObjectPrivate()
+{
+}
+
+ChemicalDataObject::ChemicalDataObject( const QVariant& v, BlueObelisk type, const QVariant& errorValue ) 
+: d(new ChemicalDataObjectPrivate()) 
 {
        d->m_value = v;
        d->m_errorValue = errorValue;
@@ -47,7 +54,6 @@ ChemicalDataObject::ChemicalDataObject() : d(new ChemicalDataObjectPrivate())
 
 bool ChemicalDataObject::operator==( const int v ) const
 {
-       kDebug() << "ChemicalDataObject::operator==() with int" << endl;
        if ( d->m_value.type() != QVariant::Int )       
                return false;
        
@@ -56,7 +62,6 @@ bool ChemicalDataObject::operator==( const int v ) const
 
 bool ChemicalDataObject::operator==( const bool v ) const
 {
-       kDebug() << "ChemicalDataObject::operator==() with bool" << endl;
        if ( d->m_value.type() != QVariant::Bool )      
                return false;
        
@@ -65,7 +70,6 @@ bool ChemicalDataObject::operator==( const bool v ) const
 
 bool ChemicalDataObject::operator==( const double v ) const
 {
-       kDebug() << "ChemicalDataObject::operator==() with double" << endl;
        if ( d->m_value.type() != QVariant::Double )    
                return false;
        
@@ -74,7 +78,6 @@ bool ChemicalDataObject::operator==( const double v ) const
 
 bool ChemicalDataObject::operator==( const QString& v ) const
 {
-       kDebug() << "ChemicalDataObject::operator==() with QString" << endl;
        if ( d->m_value.type() != QVariant::String )    
                return false;
 
index 111d0a70c63e93c0391c85311f7c430ed6c96aec..dee144202f51286a7f0fd2bfb1e374fdc2f51aca 100644 (file)
@@ -47,6 +47,10 @@ QString Element::dataAsString(ChemicalDataObject::BlueObelisk type) const
 
 Element::~Element()
 {
+    qDeleteAll(dataList);
+
+    delete m_spectrum;
+    m_spectrum = 0;
 }
 
 void Element::addData( ChemicalDataObject*o )
index 20712e0176756a2321c29983ae9cdc057e2dd490..85bb3cc5ef3aef6fddfde9f050045f8b4108bd6a 100644 (file)
@@ -30,6 +30,21 @@ Isotope::Isotope()
 
 Isotope::~Isotope()
 {
+               delete m_parentElementSymbol;
+               delete m_mass;
+               delete m_identifier;
+               delete m_spin;
+               delete m_magmoment;
+               delete m_abundance; 
+               delete m_halflife;
+               delete m_ecdecay;
+               delete m_betaplusdecay;
+               delete m_betaminusdecay; 
+               delete m_alphadecay;
+               delete m_eclikeliness;
+               delete m_betapluslikeliness;
+               delete m_betaminuslikeliness; 
+               delete m_alphalikeliness;
 }
 
 void Isotope::addData( ChemicalDataObject* o )
index b90aede116583d1d076d19abbe22fc67b59571d9..8b12afaf397510cbaf0197283447536f29d2ba32 100644 (file)
@@ -42,7 +42,7 @@ class EDUSCIENCE_EXPORT Isotope
                /**
                 * Destructor
                 */
-               virtual ~Isotope();
+               ~Isotope();
 
                /**
                 * This struct stores the information how the nucleons in the 
index 0793ed9dae49ee9e4e6561f98ff72688a4e91559..9bad5c511e33232cb9427757e80fa9bec82c4b14 100644 (file)
@@ -98,4 +98,7 @@ QList<double> Spectrum::wavelengths( double min, double max )
        return list;
 }
 
-
+Spectrum::~Spectrum()
+{
+    qDeleteAll( m_peaklist );
+}
index 5f6410300e875de3a2cd384f1e440d466e9f8a48..e4cdd372fab49de8781819ab19a6418e6496e459 100644 (file)
@@ -43,7 +43,7 @@ class EDUSCIENCE_EXPORT Spectrum
                /**
                 * public destructor
                 */
-               ~Spectrum(){};
+               ~Spectrum();
 
                /**
                 * a peak is one line in the spectrum of an element