mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
cleanup: replace membuffer by membufferpp in C-code
Thus, the membuffer data is automatically freed when going out of scope - one thing less to worry about. This fixes one use-after-free bug in uploadDiveLogsDE.cpp and one extremely questionable practice in divetooltipitem.cpp: The membuffer was a shared instance across all instances of the DiveToolTipItem. Remves unnecessary #include directives in files that didn't even use membuffer. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
f142e9a9c6
commit
16b31985c3
9 changed files with 9 additions and 21 deletions
|
@ -221,7 +221,7 @@ void ToolTipItem::setTimeAxis(DiveCartesianAxis *axis)
|
|||
|
||||
void ToolTipItem::refresh(const dive *d, const QPointF &pos, bool inPlanner)
|
||||
{
|
||||
static struct membuffer mb = {};
|
||||
struct membufferpp mb;
|
||||
|
||||
if(refreshTime.elapsed() < 40)
|
||||
return;
|
||||
|
@ -232,7 +232,6 @@ void ToolTipItem::refresh(const dive *d, const QPointF &pos, bool inPlanner)
|
|||
lastTime = time;
|
||||
clear();
|
||||
|
||||
mb.len = 0;
|
||||
int idx = get_plot_details_new(d, &pInfo, time, &mb);
|
||||
|
||||
tissues.fill();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue