Skip to content

Commit

Permalink
fix #40016: Crash when closing score
Browse files Browse the repository at this point in the history
  • Loading branch information
wschweer committed Dec 4, 2014
1 parent f3071ac commit a68454e
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 9 deletions.
2 changes: 0 additions & 2 deletions libmscore/duration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ DurationElement::DurationElement(const DurationElement& e)

DurationElement::~DurationElement()
{
if (tuplet() && !tuplet()->elements().isEmpty() && tuplet()->elements().front() == this)
delete tuplet();
}

//---------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion libmscore/segment.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class Segment : public Element {
Segment* _prev;

mutable bool empty; // cached value
mutable bool _written; // used for write()
mutable bool _written { false }; // used for write()

Type _segmentType { Type::Invalid };
int _tick;
Expand Down
5 changes: 0 additions & 5 deletions libmscore/tuplet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,6 @@ Tuplet::Tuplet(const Tuplet& t)

Tuplet::~Tuplet()
{
//
// delete all references
//
foreach(DurationElement* e, _elements)
e->setTuplet(0);
delete _number;
}

Expand Down
2 changes: 1 addition & 1 deletion libmscore/tuplet.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class Tuplet : public DurationElement {
void setRatio(const Fraction& r) { _ratio = r; }

const QList<DurationElement*>& elements() const { return _elements; }
void clear() { _elements.clear(); }
void clear() { _elements.clear(); }

virtual void layout();
Text* number() const { return _number; }
Expand Down

0 comments on commit a68454e

Please sign in to comment.