[Kstars-devel] KDE/kdeedu/kstars/kstars/skycomponents
Alexey Khudyakov
alexey.skladnoy at gmail.com
Wed Mar 2 22:07:08 CET 2011
SVN commit 1223414 by khudyakov:
Fix mempory leak! SkyPoints were never freed
CCMAIL: kstars-devel at kde.org
M +10 -13 ecliptic.cpp
M +5 -6 equator.cpp
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/ecliptic.cpp #1223413:1223414
@@ -80,27 +80,24 @@
}
void Ecliptic::drawCompassLabels() {
- QPointF cpoint;
- bool visible;
- QString label;
-
const Projector *proj = SkyMap::Instance()->projector();
KStarsData *data = KStarsData::Instance();
SkyLabeler* skyLabeler = SkyLabeler::Instance();
KSNumbers num( data->ut().djd() );
dms elat(0.0), elng(0.0);
-
+ QString label;
for( int ra = 0; ra < 23; ra += 6 ) {
elng.setH( ra );
- SkyPoint* o = new SkyPoint();
- o->setFromEcliptic( num.obliquity(), &elng, &elat );
- o->setRA0( o->ra() );
- o->setDec0( o->dec() );
- o->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
- cpoint = proj->toScreen( o, false, &visible );
- if ( proj->checkVisibility( o ) && visible ) {
- label.setNum( o->ra().reduce().Degrees() );
+ SkyPoint o;
+ o.setFromEcliptic( num.obliquity(), &elng, &elat );
+ o.setRA0( o.ra() );
+ o.setDec0( o.dec() );
+ o.EquatorialToHorizontal( data->lst(), data->geo()->lat() );
+ bool visible;
+ QPointF cpoint = proj->toScreen( &o, false, &visible );
+ if( visible && proj->checkVisibility( &o ) ) {
+ label.setNum( o.ra().reduce().Degrees() );
skyLabeler->drawGuideLabel( cpoint, label, 0.0 );
}
}
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/equator.cpp #1223413:1223414
@@ -81,7 +81,6 @@
}
void Equator::drawCompassLabels() {
- QPointF cpoint;
QString label;
const Projector *proj = SkyMap::Instance()->projector();
@@ -91,12 +90,12 @@
KSNumbers num( data->ut().djd() );
for( int ra = 0; ra < 23; ra += 2 ) {
- SkyPoint* o = new SkyPoint( ra, 0.0 );
- o->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
+ SkyPoint o( ra, 0.0 );
+ o.EquatorialToHorizontal( data->lst(), data->geo()->lat() );
bool visible;
- cpoint = proj->toScreen( o, false, &visible );
- if ( visible && proj->checkVisibility( o ) ) {
- label.setNum( o->ra().hour() );
+ QPointF cpoint = proj->toScreen( &o, false, &visible );
+ if ( visible && proj->checkVisibility( &o ) ) {
+ label.setNum( o.ra().hour() );
skyLabeler->drawGuideLabel( cpoint, label, 0.0 );
}
}
More information about the Kstars-devel
mailing list