From kde-commits Thu Nov 24 14:20:10 2011 From: Khudyakov Alexey Date: Thu, 24 Nov 2011 14:20:10 +0000 To: kde-commits Subject: [kstars] kstars/widgets: Fix memory leak Message-Id: <20111124142010.8BCC6A60C4 () git ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=132214449216460 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/mo= onphasecalendarwidget.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 =3D new KSPlanet( I18N_NOOP( "Earth" ), QString(), Q= Color( "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();