Bug report #9319
copy of QgsExpression causes segfault
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||Yes||Resolution:||fixed/implemented|
|Crashes QGIS or corrupts data:||Yes||Copied to github as #:||17926|
The default copy and assigment operator of QgsExpression causes segfault (multiple delete) if used.
Since the copy and assigment operator are not used anywhere I just made the class non-copyable (so the future developers won't get caught like I was)
The pull request is there: https://github.com/qgis/QGIS/pull/1075
#3 Updated by Matthias Kuhn about 6 years ago
- Status changed from Closed to Reopened
I can still copy and I get the same crash.
QgsExpression* exp = new QgsExpression( "1" ); QgsExpression* exp2 = new QgsExpression( exp ); delete ( exp ); delete ( exp2 );
Proposal: make this class implicitly shared.