[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kstars] kstars/widgets: Fix memory leak
From: Khudyakov Alexey <alexey.skladnoy () gmail ! com>
Date: 2011-11-24 14:20:10
Message-ID: 20111124142010.8BCC6A60C4 () git ! kde ! org
[Download RAW message or body]
Git commit 444b23c876efbeedc7de221e97250608377b150a by Khudyakov Alexey.
Committed on 17/11/2011 at 21:25.
Pushed by khudyakov into branch 'master'.
Fix memory leak
M +3 -4 kstars/widgets/moonphasecalendarwidget.cpp
http://commits.kde.org/kstars/444b23c876efbeedc7de221e97250608377b150a
diff --git a/kstars/widgets/moonphasecalendarwidget.cpp \
b/kstars/widgets/moonphasecalendarwidget.cpp index 497c664..1404dc0 100644
--- a/kstars/widgets/moonphasecalendarwidget.cpp
+++ b/kstars/widgets/moonphasecalendarwidget.cpp
@@ -295,11 +295,10 @@ void MoonPhaseCalendar::paintCell( QPainter *painter, int row, \
int col, const KC unsigned short MoonPhaseCalendar::computeMoonPhase( const \
KStarsDateTime &date ) {
KSNumbers num( date.djd() );
+ KSPlanet earth( KSPlanet::Earth );
+ earth->findPosition( &num );
- KSPlanet *m_Earth = new KSPlanet( I18N_NOOP( "Earth" ), QString(), QColor( \
"white" ), 12756.28 /*diameter in km*/ );
- m_Earth->findPosition( &num );
-
- m_Moon.findGeocentricPosition( &num, m_Earth );
+ m_Moon.findGeocentricPosition( &num, earth );
m_Moon.findPhase();
return m_Moon.getIPhase();
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic