diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-12-19 12:32:24 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-12-19 12:54:24 +0000 |
commit | d14b4a6b874e46fbb1434e523a1ffd993e5c9d44 (patch) | |
tree | c994b216b82d04c436b25e27c1a037ae8cf22417 /vcl | |
parent | e32fd5e8671b787dfc6795f3109c616974fe2594 (diff) |
coverity#1028600 Uninitialized scalar field
Change-Id: I0b4ee14ea2306786351ce20960a05e8f3058fb21
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/window.h | 2 | ||||
-rw-r--r-- | vcl/source/window/event.cxx | 6 | ||||
-rw-r--r-- | vcl/source/window/window.cxx | 1 |
3 files changed, 5 insertions, 4 deletions
diff --git a/vcl/inc/window.h b/vcl/inc/window.h index e95036910657..184c7a9fb14a 100644 --- a/vcl/inc/window.h +++ b/vcl/inc/window.h @@ -232,7 +232,7 @@ public: VclPtr<vcl::Window> mpDlgCtrlDownWindow; std::vector<Link<VclWindowEvent&,void>> maEventListeners; std::vector<Link<VclWindowEvent&,void>> maChildEventListeners; - int maChildEventListenersIteratingCount; + int mnChildEventListenersIteratingCount; std::set<Link<VclWindowEvent&,void>> maChildEventListenersDeleted; // The canvas interface for this VCL window. Is persistent after the first GetCanvas() call diff --git a/vcl/source/window/event.cxx b/vcl/source/window/event.cxx index c001c7e9ca43..85da86cabbc6 100644 --- a/vcl/source/window/event.cxx +++ b/vcl/source/window/event.cxx @@ -245,11 +245,11 @@ void Window::CallEventListeners( sal_uLong nEvent, void* pData ) // Copy the list, because this can be destroyed when calling a Link... std::vector<Link<VclWindowEvent&,void>> aCopy( rWindowImpl.maChildEventListeners ); // we use an iterating counter/flag and a set of deleted Link's to avoid O(n^2) behaviour - rWindowImpl.maChildEventListenersIteratingCount++; + rWindowImpl.mnChildEventListenersIteratingCount++; comphelper::ScopeGuard aGuard( [&rWindowImpl]() { - if (--rWindowImpl.maChildEventListenersIteratingCount == 0) + if (--rWindowImpl.mnChildEventListenersIteratingCount == 0) rWindowImpl.maChildEventListenersDeleted.clear(); } ); @@ -302,7 +302,7 @@ void Window::RemoveChildEventListener( const Link<VclWindowEvent&,void>& rEventL { auto& rListeners = mpWindowImpl->maChildEventListeners; rListeners.erase( std::remove(rListeners.begin(), rListeners.end(), rEventListener ), rListeners.end() ); - if (mpWindowImpl->maChildEventListenersIteratingCount) + if (mpWindowImpl->mnChildEventListenersIteratingCount) mpWindowImpl->maChildEventListenersDeleted.insert(rEventListener); } } diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index cbfcc37b1dcc..cc8973d4ebba 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -631,6 +631,7 @@ WindowImpl::WindowImpl( WindowType nType ) mpNextOverlap = nullptr; // next overlap window of frame mpLastFocusWindow = nullptr; // window for focus restore mpDlgCtrlDownWindow = nullptr; // window for dialog control + mnChildEventListenersIteratingCount = 0; mpFirstDel = nullptr; // Dtor notification list mpUserData = nullptr; // user data mpCursor = nullptr; // cursor |