[Kstars-devel] Bug in moon position?

Akarsh Simha akarshsimha at gmail.com
Fri May 30 23:36:12 CEST 2008


Hi

The bug was not associated with the conjunction tool, but with the
calculator. 

The calculator seems to initialize and destruct a KMoon when it is
opened. This used to cause the destruction of all data in the static
members of KSMoon due to a call to ~KSMoon(), which caused problems in
further computation, because KSMoon::data_loaded was still set to
true.

The previous commit fixes this.

I initially thought it was the conjunction tool that was destroying a
KSMoon and causing the trouble, but it turned out that the conjunction
tool was not deleting its objects either. While the fix worked, I
checked with my branch and found out that it was the Calculator itself
destructing KSMoon.

While I could've simply set data_loaded to false in the destructor, I
thought it was a better idea to keep count of instances, and thus
prevent us from re-loading the data each time we use the Calculator,
Conjunction Module or the Planet Positions Module. I hope this is ok.

Regards
Akarsh


More information about the Kstars-devel mailing list