Skip to content

Commit

Permalink
Merge pull request #1144 from ivandi69/1143-fix
Browse files Browse the repository at this point in the history
Fix #1143
  • Loading branch information
ra3xdh authored Dec 17, 2024
2 parents f152ee2 + c74ae46 commit c04edc6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion qucs/diagrams/diagram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,10 @@ int Graph::loadDatFile(const QString &fileName) {
qDeleteAll(g->mutable_axes());
g->mutable_axes().clear();
g->countY = 0;
delete[] g->cPointsY;
if (g->cPointsY != nullptr) {
delete[] g->cPointsY;
g->cPointsY = nullptr;
}
if (Variable.isEmpty()) return 0;

#if 0 // FIXME encapsulation. implement digital waves later.
Expand Down
5 changes: 4 additions & 1 deletion qucs/diagrams/graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,11 @@ Graph::Graph(Diagram const* d, const QString& _Line) :

Graph::~Graph()
{
if (cPointsY != nullptr) {
delete[] cPointsY;
qDeleteAll(cPointsX);
cPointsY = nullptr;
}
qDeleteAll(cPointsX);
}

// ---------------------------------------------------------------------
Expand Down

0 comments on commit c04edc6

Please sign in to comment.