summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Cord-Landwehr <cordlandwehr@kde.org>2016-04-18 19:47:50 (GMT)
committerAndreas Cord-Landwehr <cordlandwehr@kde.org>2016-04-18 19:47:50 (GMT)
commit9b1fe3393b63a2e0e6b4161abb154fe989ee3f6f (patch)
tree0d81b4c51ac65a993a78fa8816861ba23e21886c
parentee89aa4a7f33c1be07c53b2eda0e5c27ac9f8dcb (diff)
Use existing API.
Previous code required a still unmerge pull request.
-rw-r--r--src/tools/moleculeview.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/tools/moleculeview.cpp b/src/tools/moleculeview.cpp
index 07fd678..3f19728 100644
--- a/src/tools/moleculeview.cpp
+++ b/src/tools/moleculeview.cpp
@@ -172,9 +172,8 @@ void MoleculeDialog::loadMolecule(const QString &filename)
qDebug() << "Filename to load: " << filename;
- auto tmpMol = IoWrapper::readMolecule(filename);
- auto molecule = new Avogadro::QtGui::Molecule(*tmpMol);
- delete tmpMol;
+ Avogadro::QtGui::Molecule tmpMol = *IoWrapper::readMolecule(filename);
+ auto molecule = new Avogadro::QtGui::Molecule(tmpMol);
// Check that a valid molecule object was returned
if (!molecule) {