summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkarsh Simha <akarsh@kde.org>2016-08-18 08:46:34 (GMT)
committerAkarsh Simha <akarsh@kde.org>2016-08-18 08:47:59 (GMT)
commitdbcc3756aba9901b6bbf0b29ef0bd7a5a168fcd2 (patch)
tree062b8d2888e69f609c67ee45aafb1d615ae952b3
parent52d368d09c896b6a1cab32e46b2fb06935b9fdd2 (diff)
Fix crash in SyncedCatalogComponent. I'm an idiot.
Wrapped the initialization in a Q_ASSERT by mistake -- Q_ASSERTs are not evaluated unless running in debug mode, so program crashes in non-debug mode due to dangling pointer db.
-rw-r--r--kstars/skycomponents/syncedcatalogcomponent.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/kstars/skycomponents/syncedcatalogcomponent.cpp b/kstars/skycomponents/syncedcatalogcomponent.cpp
index 2bef403..74e78ec 100644
--- a/kstars/skycomponents/syncedcatalogcomponent.cpp
+++ b/kstars/skycomponents/syncedcatalogcomponent.cpp
@@ -31,8 +31,8 @@ SyncedCatalogComponent::SyncedCatalogComponent( SkyComposite *parent,
: CatalogComponent( parent, catname, showerrs, index, false ) {
// First check if the catalog exists
- CatalogDB *db;
- Q_ASSERT( db = KStarsData::Instance()->catalogdb() );
+ CatalogDB *db = KStarsData::Instance()->catalogdb();
+ Q_ASSERT( db );
m_catId = db->FindCatalog( catname );
if( m_catId >= 0 )
loadData();