Skip to content

Commit

Permalink
Merge pull request #1928 from ghutchis/avoid-orbital-switch-crash
Browse files Browse the repository at this point in the history
Avoid crash in orbitals when switching molecules
  • Loading branch information
ghutchis authored Jan 9, 2025
2 parents 38071a5 + 33de765 commit af2b88c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
5 changes: 3 additions & 2 deletions avogadro/qtplugins/quantuminput/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ set(_prefix "${AvogadroLibs_SOURCE_DIR}/../avogadrogenerators")
if(EXISTS "${_prefix}/generators.cmake")
# Bundled generator scripts,
include("${_prefix}/generators.cmake")
message("We have ${input_generators}")
# message("We have ${input_generators}")
unset(_generators)
foreach(gen ${input_generators})
list(APPEND _generators "${_prefix}/${gen}")
endforeach()
message("We have ${_generators}")
# debugging info with paths
# message("We have ${_generators}")

option(INSTALL_TEST_INPUT_GENERATOR
"Install a dummy input generator that is used to test generator scripts."
Expand Down
5 changes: 0 additions & 5 deletions avogadro/qtplugins/surfaces/orbitals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,6 @@ void Orbitals::setMolecule(QtGui::Molecule* mol)
m_currentRunningCalculation = -1;
m_currentMeshCalculation = -1;

if (m_basis) {
delete m_basis;
m_basis = nullptr;
}

loadBasis();

if (!m_basis || m_basis->electronCount() == 0 || !hasOrbitals)
Expand Down

0 comments on commit af2b88c

Please sign in to comment.