mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-04-15 05:32:21 +00:00
Add DataFilter destructor calling clearFilter to release memory
The crash documented in #4249 was related to the conversion of Leaf of type Symbol to Function when () are found afterwards. This is fixed in this commit, but more testing is necessary to see if there are other cases.
This commit is contained in:
committed by
Mark Liversedge
parent
d5905d92d0
commit
327150d659
@@ -219,6 +219,7 @@ class DataFilter : public QObject
|
||||
public:
|
||||
DataFilter(QObject *parent, Context *context);
|
||||
DataFilter(QObject *parent, Context *context, QString formula);
|
||||
~DataFilter() { clearFilter(); }
|
||||
|
||||
// runtime passed by datafilter
|
||||
DataFilterRuntime rt;
|
||||
|
||||
@@ -458,6 +458,8 @@ expr:
|
||||
$1->type = Leaf::Function;
|
||||
$1->series = NULL; // not tiz/best
|
||||
$1->function = *($1->lvalue.n);
|
||||
delete $1->lvalue.n; // not used anymore
|
||||
$1->lvalue.l = NULL; // avoid double deletion
|
||||
$1->fparms.clear(); // no parameters!
|
||||
}
|
||||
| '(' expr ')' { $$ = new Leaf(@2.first_column, @2.last_column);
|
||||
|
||||
Reference in New Issue
Block a user