mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Profile: properly initialize plot_info structures
The create_plot_info_new() function releases old plot data. This can only work if the plot_info structure was initialized previously. The ProfileWidget2 did that by a memset, but other parts of the code did not. Therefore, introduce a init_plot_info() function and call that when generating a plot_info struct. Constructors would make this so much easier - but since this is called from C, we can't use them. Fixes #2251 Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
0e55739f03
commit
25b30da244
7 changed files with 18 additions and 4 deletions
|
@ -148,7 +148,7 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) : QGraphicsView(parent),
|
|||
// would like to be able to ASSERT here that PreferencesDialog::loadSettings has been called.
|
||||
isPlotZoomed = prefs.zoomed_plot; // now it seems that 'prefs' has loaded our preferences
|
||||
|
||||
memset(&plotInfo, 0, sizeof(plotInfo));
|
||||
init_plot_info(&plotInfo);
|
||||
|
||||
setupSceneAndFlags();
|
||||
setupItemSizes();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue