Project

General

Profile

Bug #3539

WTimer::singleShot() can leak memory

Added by Boris Nagaev almost 8 years ago. Updated almost 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
08/22/2014
Due date:
% Done:

0%

Estimated time:

Description

Here is implementation of WTimer::singleShot():

template

void WTimer::singleShot(int msec, const F& f)

{

WTimer *timer = new WTimer();

timer->setSingleShot(true);

timer->setInterval(msec);

timer->setSelfDestruct();

timer->start();

timer->timeout().connect(f);

}

timer deletes itself in "shot".

But it leaks if it never shots.

This can happen for the following reasons:

  • session deads before it shots,
  • memory leak attack.
#1

Updated by Koen Deforche almost 8 years ago

  • Status changed from New to Resolved
  • Assignee set to Koen Deforche
  • Target version set to 3.3.4

Ah, good observation, fixed!

#2

Updated by Koen Deforche almost 8 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF