Project

General

Profile

Actions

Bug #3539

closed

WTimer::singleShot() can leak memory

Added by Boris Nagaev over 10 years ago. Updated about 10 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.
Actions #1

Updated by Koen Deforche about 10 years ago

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

Ah, good observation, fixed!

Actions #2

Updated by Koen Deforche about 10 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF