kwin: Initialize QElapsedTimers by calling invalidate()
QElapsedTimer doesn't have a constructor that initializes the private members. This means that calls to isValid() will depend on uninitialized data when the timer has never been started. elapsed() and restart() will also use and return values computed from uninitialized data. This fixes several valgrind errors.
This commit is contained in:
parent
67e79ea13a
commit
44165bb0d1
2 changed files with 3 additions and 0 deletions
|
@ -98,6 +98,7 @@ Scene::Scene(Workspace* ws)
|
||||||
, lanczos_filter(new LanczosFilter())
|
, lanczos_filter(new LanczosFilter())
|
||||||
, m_overlayWindow(new OverlayWindow())
|
, m_overlayWindow(new OverlayWindow())
|
||||||
{
|
{
|
||||||
|
last_time.invalidate(); // Initialize the timer
|
||||||
}
|
}
|
||||||
|
|
||||||
Scene::~Scene()
|
Scene::~Scene()
|
||||||
|
|
|
@ -222,6 +222,8 @@ Workspace::Workspace(bool restore)
|
||||||
// need to create the tabbox before compositing scene is setup
|
// need to create the tabbox before compositing scene is setup
|
||||||
tab_box = new TabBox::TabBox(this);
|
tab_box = new TabBox::TabBox(this);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
nextPaintReference.invalidate(); // Initialize the timer
|
||||||
setupCompositing();
|
setupCompositing();
|
||||||
|
|
||||||
// Compatibility
|
// Compatibility
|
||||||
|
|
Loading…
Reference in a new issue