Mir

Merge lp:~hikiko/mir/mir.fix-missing-virtual-destructors into lp:~mir-team/mir/trunk

Proposed by Eleni Maria Stea
Status: Work in progress
Proposed branch: lp:~hikiko/mir/mir.fix-missing-virtual-destructors
Merge into: lp:~mir-team/mir/trunk
Diff against target: 1386 lines (+183/-29)
55 files modified
3rd_party/cucumber-cpp/CTestTestfile.cmake (+2/-3)
3rd_party/cucumber-cpp/include/cucumber-cpp/internal/hook/HookRegistrar.hpp (+2/-0)
3rd_party/cucumber-cpp/include/cucumber-cpp/internal/hook/Tag.hpp (+1/-0)
3rd_party/cucumber-cpp/include/cucumber-cpp/internal/step/StepManager.hpp (+2/-0)
3rd_party/cucumber-cpp/src/CTestTestfile.cmake (+2/-2)
3rd_party/cucumber-cpp/src/connectors/wire/WireProtocol.cpp (+1/-0)
3rd_party/cucumber-cpp/tests/CTestTestfile.cmake (+2/-2)
3rd_party/cucumber-cpp/tests/utils/DriverTestRunner.hpp (+1/-0)
3rd_party/gmock-1.6.0/gtest/fused-src/gtest/gtest.h (+2/-1)
3rd_party/gmock-1.6.0/gtest/include/gtest/internal/gtest-param-util.h (+2/-1)
3rd_party/gmock-1.6.0/include/gmock/gmock-actions.h (+24/-0)
3rd_party/gmock-1.6.0/include/gmock/gmock-generated-actions.h (+2/-0)
3rd_party/gmock-1.6.0/include/gmock/gmock-matchers.h (+44/-0)
include/server/mir/compositor/buffer_allocation_strategy.h (+1/-2)
include/server/mir/default_server_configuration.h (+1/-0)
include/server/mir/frontend/session_mediator_report.h (+2/-0)
include/server/mir/graphics/display.h (+1/-1)
include/server/mir/graphics/display_report.h (+1/-1)
include/server/mir/graphics/platform.h (+2/-0)
include/server/mir/graphics/viewable_area.h (+1/-1)
include/server/mir/logging/display_report.h (+1/-1)
include/server/mir/options/option.h (+1/-1)
include/server/mir/options/program_option.h (+1/-0)
include/server/mir/server_configuration.h (+1/-1)
include/server/mir/surfaces/buffer_bundle.h (+2/-0)
include/test/mir_test_doubles/mock_android_alloc_device.h (+1/-0)
include/test/mir_test_doubles/mock_display_report.h (+2/-0)
include/test/mir_test_doubles/mock_viewable_area.h (+1/-0)
include/test/mir_test_framework/testing_process_manager.h (+1/-0)
include/test/mir_test_framework/testing_server_configuration.h (+1/-0)
src/client/android/android_client_buffer.cpp (+4/-0)
src/client/android/android_registrar.h (+2/-0)
src/client/client_platform.h (+2/-0)
src/server/frontend/message_processor.h (+1/-1)
src/server/frontend/socket_session.cpp (+0/-1)
src/server/frontend/socket_session.h (+2/-0)
src/server/graphics/gbm/gbm_display.cpp (+2/-1)
src/server/graphics/gbm/gbm_display.h (+1/-1)
src/server/graphics/gbm/gbm_platform.cpp (+1/-2)
src/server/graphics/gbm/gbm_platform.h (+1/-1)
src/server/logging/display_report.cpp (+1/-1)
src/server/options/program_option.cpp (+4/-0)
tests/acceptance-tests/test_client_input.cpp (+4/-0)
tests/integration-tests/compositor/multithread_harness.h (+4/-3)
tests/integration-tests/frontend/test_application_mediator_report.cpp (+12/-0)
tests/integration-tests/test_display_server_main_loop_events.cpp (+4/-0)
tests/integration-tests/test_surface_first_frame_sync.cpp (+9/-1)
tests/integration-tests/test_surfaceloop.cpp (+6/-0)
tests/unit-tests/client/android/test_client_android_registrar.cpp (+2/-0)
tests/unit-tests/client/test_mir_connection.cpp (+4/-0)
tests/unit-tests/compositor/test_buffer_manager.cpp (+2/-0)
tests/unit-tests/frontend/test_session_mediator.cpp (+2/-0)
tests/unit-tests/graphics/android/test_android_framebuffer_window.cpp (+1/-0)
tests/unit-tests/shell/test_consuming_placement_strategy.cpp (+2/-0)
tests/unit-tests/test_gmock_fixes.cpp (+2/-0)
To merge this branch: bzr merge lp:~hikiko/mir/mir.fix-missing-virtual-destructors
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Robert Ancell Needs Fixing
Alan Griffiths Needs Fixing
Alexandros Frantzis (community) Needs Fixing
Review via email: mp+165464@code.launchpad.net

Commit message

This branch fixes the bug 1183507: https://bugs.launchpad.net/mir/+bug/1183507
I searched all the classes that have instances inside the directiry src/ and I wrote a virtual destructor in those that had at least one virtual function so that they won't cause memory leaks. I will continue the search into the other directories as well and submit more branches if necessary.

Description of the change

This branch fixes the bug 1183507: https://bugs.launchpad.net/mir/+bug/1183507
I searched all the classes that have instances inside the directiry src/ and I wrote a virtual destructor in those that had at least one virtual function so that they won't cause memory leaks. I will continue the search into the other directories as well and submit more branches if necessary.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

For reference, the canonical form of an abstract base class ("interface") in Mir, is described in https://lists.ubuntu.com/archives/mir-devel/2013-March/000036.html (or see include/server/mir/main_loop.h for a real example). Note the update to use "= default;" for the destructor. Not all classes use this form yet, but we are updating older classes as we come across them in MPs.

23 +mcla::AndroidClientPlatform::~AndroidClientPlatform()
38 + virtual ~AndroidClientPlatform();

Not needed here. The base class destructor should be made virtual.

50 +mcla::AndroidRegistrarGralloc::~AndroidRegistrarGralloc()
78 + virtual ~AndroidRegistrarGralloc();

Not needed. The added virtual base class destructor (AndroidRegistrar) is enough.

65 + virtual ~AndroidRegistrar() = default;

Tab instead of spaces.

103 + virtual ~NullMessageProcessor() = default;

Not needed here. The base class destructor should be made virtual.

115 +mfd::SocketSession::~SocketSession()
129 + virtual ~SocketSession();

Not needed here. The base class destructor should be made virtual.

142 +mga::AndroidPlatform::~AndroidPlatform()
157 + virtual ~AndroidPlatform();

Not needed here. The base class destructor should be made virtual.

170 + virtual ~GBMDisplay();

Not needed here. The base class destructor should be made virtual.

review: Needs Fixing
Revision history for this message
Eleni Maria Stea (hikiko) wrote :

I added the virtual both in the base classes and the subclasses for clarity reasons (you don't have to follow the whole hierarchy to see what is virtual) but ok, I'll remove them from the subclasses.

+the tab... :p

actually that comment was going here:
https://bugs.launchpad.net/mir/+bug/1183507/comments/3

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

Shouldn't -Weffc++ warn about any classes with problems? And -Werror stop the compile?

review: Needs Fixing
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> Shouldn't -Weffc++ warn about any classes with problems? And -Werror stop the
> compile?

C.f. https://code.launchpad.net/~alan-griffiths/mir/Wno-non-virtual-dtor/+merge/165551

Revision history for this message
Eleni Maria Stea (hikiko) wrote :

ok I think it's ok now, could you review it again?

Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

100 -mgg::GBMDisplay::~GBMDisplay()
101 -{
102 -}

127 +#include "gbm_display_buffer.h"
139 +#include "src/server/graphics/gbm/gbm_display_buffer.h"

The empty destructor needs to be there so that that unique_ptr to
an incomplete type can work. We should add a comment explaining why
we need it there, rather than working around it and adding false
header dependencies.

review: Needs Fixing
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

I think you should merge in lp:~alan-griffiths/mir/Wno-non-virtual-dtor/

~~~~

+1 to Alf's comments about ~GBMDisplay()

~~~~

I'm not convinced that the changes to 3rd_party code are needed. Are these classes really used in a way that causes problems? Otherwise "not broke, don't fix" applies.

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Eleni Maria Stea (hikiko) wrote :

ok

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :
review: Needs Fixing
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

I don't think you should be changing classes that don't need changing.There are so many of these that reviewing is impractical.

Probably all of those under 3rd_party need reverting and definitely those in 3rd_party/gmock-1.6.0/include/gmock/gmock-actions.h. Look at the first of these:

template <typename T>
class BuiltInDefaultValue {
 public:
  // This function returns true iff type T has a built-in default value.
  static bool Exists() { return false; }
  static T Get() {
    Assert(false, __FILE__, __LINE__,
           "Default action undefined for the function return type.");
    return internal::Invalid<T>();
    // The above statement will never be reached, but is required in
    // order for this function to compile.
  }
};

This doesn't need a virtual destructor - it is not used polymorphically.

If you want to spend time on this I think you should

/1/ start with trunk

/2/ merge in lp:~alan-griffiths/mir/Wno-non-virtual-dtor/

/3/ Fix the *few* classes that it flags up.

review: Needs Fixing
Revision history for this message
Eleni Maria Stea (hikiko) wrote :

@Alan: yes I thought jenkins merges automatically all the approved branches but I was wrong, I just merged it manually!

It seems that not specifying any exceptions in gcc means that the destructor is trying to throw all the exceptions (in clang it just throws the exceptions specified in the parent v. destructor which means it allows no exceptions) I added a noexcept to the classes affected.

An idea:
Maybe I could remove the "noexcept" as well as the "default" from the destructors and just use virtual destructors in the classes. Otherwise, in the (probably insane) case that someone wants to throw an exception inside a destructor, we might have a problem. Atm I did it like that because I've seen other noexcept in the code and in the very first correction (@Alexandros) suggests that we make the default destructor of the base class virtual.

@Alexandros, @Alan: any thoughts?

Revision history for this message
Robert Ancell (robert-ancell) wrote :

Note, there are still many tab characters in this branch.

Revision history for this message
Robert Ancell (robert-ancell) wrote :

+1 on reverting the 3rd_party changes for this branch to make it easier to review and have less side effects. Since we didn't write any of the 3rd_party stuff in the first place it needs more checking to see if it is worth it. Also, changing 3rd_party means it is harder for us to merge in upstream changes to that code in the future so any changes need to be important.

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> +1 on reverting the 3rd_party changes for this branch to make it easier to
> review and have less side effects. Since we didn't write any of the 3rd_party
> stuff in the first place it needs more checking to see if it is worth it.
> Also, changing 3rd_party means it is harder for us to merge in upstream
> changes to that code in the future so any changes need to be important.

It may not be quite that simple - we include 3rd party headers in our code, and unless we disable warnings around those includes (which is ugly) these can cause compiler diagnostics.

Also, Eleni tells me that some memory leaks are fixed. (I've not spotted changes that would explain these yet, but fixing leaks is worthwhile - even in 3rd_party.)

I've had a chat with Eleni about coming up with a simpler set of changes that are easier to review.

Revision history for this message
Eleni Maria Stea (hikiko) wrote :

Hello, I made a new branch + fixed the tabs here:
https://code.launchpad.net/~hikiko/mir/mir.fix-virt-destructorS

I haven't remove the changes in the 3rd party yet, because some of them fix memory leaks, but I want to refactor it a bit.

I didn't remove the merge proposal of this branch because if I do so, the comments will be deleted too.

Revision history for this message
Eleni Maria Stea (hikiko) wrote :

(the new branch is shorter and maybe I can remove some fixes to make it even shorter)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '3rd_party/cucumber-cpp/CTestTestfile.cmake'
2--- 3rd_party/cucumber-cpp/CTestTestfile.cmake 2013-01-03 21:26:48 +0000
3+++ 3rd_party/cucumber-cpp/CTestTestfile.cmake 2013-05-30 07:52:28 +0000
4@@ -1,9 +1,8 @@
5 # CMake generated Testfile for
6-# Source directory: /home/augustwest/src/cucumber-cpp
7-# Build directory: /home/augustwest/src/cucumber-cpp
8+# Source directory: /home/hikiko/staging/gcc/mir.fix-missing-virtual-destructors/3rd_party/cucumber-cpp
9+# Build directory: /home/hikiko/staging/gcc/mir.fix-missing-virtual-destructors/3rd_party/cucumber-cpp
10 #
11 # This file includes the relevent testing commands required for
12 # testing this directory and lists subdirectories to be tested as well.
13 SUBDIRS(src)
14 SUBDIRS(tests)
15-SUBDIRS(examples)
16
17=== modified file '3rd_party/cucumber-cpp/include/cucumber-cpp/internal/hook/HookRegistrar.hpp'
18--- 3rd_party/cucumber-cpp/include/cucumber-cpp/internal/hook/HookRegistrar.hpp 2013-01-03 21:26:48 +0000
19+++ 3rd_party/cucumber-cpp/include/cucumber-cpp/internal/hook/HookRegistrar.hpp 2013-05-30 07:52:28 +0000
20@@ -15,11 +15,13 @@
21
22 class CallableStep {
23 public:
24+ virtual ~CallableStep() = default;
25 virtual void call() = 0;
26 };
27
28 class Hook {
29 public:
30+ virtual ~Hook() = default;
31 void setTags(const std::string &csvTagNotation);
32 virtual void invokeHook(Scenario *scenario);
33 virtual void skipHook();
34
35=== modified file '3rd_party/cucumber-cpp/include/cucumber-cpp/internal/hook/Tag.hpp'
36--- 3rd_party/cucumber-cpp/include/cucumber-cpp/internal/hook/Tag.hpp 2013-01-03 21:26:48 +0000
37+++ 3rd_party/cucumber-cpp/include/cucumber-cpp/internal/hook/Tag.hpp 2013-05-30 07:52:28 +0000
38@@ -14,6 +14,7 @@
39
40 class TagExpression {
41 public:
42+ virtual ~TagExpression() = default;
43 typedef std::vector<std::string> tag_list;
44
45 virtual bool matches(const tag_list &tags) = 0;
46
47=== modified file '3rd_party/cucumber-cpp/include/cucumber-cpp/internal/step/StepManager.hpp'
48--- 3rd_party/cucumber-cpp/include/cucumber-cpp/internal/step/StepManager.hpp 2013-01-03 21:26:48 +0000
49+++ 3rd_party/cucumber-cpp/include/cucumber-cpp/internal/step/StepManager.hpp 2013-05-30 07:52:28 +0000
50@@ -100,6 +100,7 @@
51 class StepInfo {
52 public:
53 StepInfo(const std::string &stepMatcher, const std::string source);
54+ virtual ~StepInfo() = default;
55 SingleStepMatch matches(const std::string &stepDescription);
56 virtual InvokeResult invokeStep(const InvokeArgs * pArgs) = 0;
57
58@@ -111,6 +112,7 @@
59
60 class BasicStep {
61 public:
62+ virtual ~BasicStep() = default;
63 InvokeResult invoke(const InvokeArgs *pArgs);
64
65 protected:
66
67=== modified file '3rd_party/cucumber-cpp/src/CTestTestfile.cmake'
68--- 3rd_party/cucumber-cpp/src/CTestTestfile.cmake 2013-01-03 21:26:48 +0000
69+++ 3rd_party/cucumber-cpp/src/CTestTestfile.cmake 2013-05-30 07:52:28 +0000
70@@ -1,6 +1,6 @@
71 # CMake generated Testfile for
72-# Source directory: /home/augustwest/src/cucumber-cpp/src
73-# Build directory: /home/augustwest/src/cucumber-cpp/src
74+# Source directory: /home/hikiko/staging/gcc/mir.fix-missing-virtual-destructors/3rd_party/cucumber-cpp/src
75+# Build directory: /home/hikiko/staging/gcc/mir.fix-missing-virtual-destructors/3rd_party/cucumber-cpp/src
76 #
77 # This file includes the relevent testing commands required for
78 # testing this directory and lists subdirectories to be tested as well.
79
80=== modified file '3rd_party/cucumber-cpp/src/connectors/wire/WireProtocol.cpp'
81--- 3rd_party/cucumber-cpp/src/connectors/wire/WireProtocol.cpp 2013-01-03 21:26:48 +0000
82+++ 3rd_party/cucumber-cpp/src/connectors/wire/WireProtocol.cpp 2013-05-30 07:52:28 +0000
83@@ -88,6 +88,7 @@
84
85 class CommandDecoder {
86 public:
87+ virtual ~CommandDecoder() = default;
88 virtual WireCommand *decode(const mValue & jsonArgs) const = 0;
89 };
90
91
92=== modified file '3rd_party/cucumber-cpp/tests/CTestTestfile.cmake'
93--- 3rd_party/cucumber-cpp/tests/CTestTestfile.cmake 2013-01-03 21:26:48 +0000
94+++ 3rd_party/cucumber-cpp/tests/CTestTestfile.cmake 2013-05-30 07:52:28 +0000
95@@ -1,6 +1,6 @@
96 # CMake generated Testfile for
97-# Source directory: /home/augustwest/src/cucumber-cpp/tests
98-# Build directory: /home/augustwest/src/cucumber-cpp/tests
99+# Source directory: /home/hikiko/staging/gcc/mir.fix-missing-virtual-destructors/3rd_party/cucumber-cpp/tests
100+# Build directory: /home/hikiko/staging/gcc/mir.fix-missing-virtual-destructors/3rd_party/cucumber-cpp/tests
101 #
102 # This file includes the relevent testing commands required for
103 # testing this directory and lists subdirectories to be tested as well.
104
105=== modified file '3rd_party/cucumber-cpp/tests/utils/DriverTestRunner.hpp'
106--- 3rd_party/cucumber-cpp/tests/utils/DriverTestRunner.hpp 2013-01-03 21:26:48 +0000
107+++ 3rd_party/cucumber-cpp/tests/utils/DriverTestRunner.hpp 2013-05-30 07:52:28 +0000
108@@ -68,6 +68,7 @@
109 DriverTest() {
110 failedTests = 0;
111 }
112+ virtual ~DriverTest() = default;
113 protected:
114 void expectTrue(const char *description, bool condition) {
115 updateState(description, condition);
116
117=== modified file '3rd_party/gmock-1.6.0/gtest/fused-src/gtest/gtest.h'
118--- 3rd_party/gmock-1.6.0/gtest/fused-src/gtest/gtest.h 2012-09-05 06:40:45 +0000
119+++ 3rd_party/gmock-1.6.0/gtest/fused-src/gtest/gtest.h 2013-05-30 07:52:28 +0000
120@@ -10307,7 +10307,7 @@
121 template <class ParamType>
122 class TestMetaFactoryBase {
123 public:
124- virtual ~TestMetaFactoryBase() {}
125+ virtual ~TestMetaFactoryBase() = default;
126
127 virtual TestFactoryBase* CreateTestFactory(ParamType parameter) = 0;
128 };
129@@ -10327,6 +10327,7 @@
130 typedef typename TestCase::ParamType ParamType;
131
132 TestMetaFactory() {}
133+ virtual ~TestMetaFactory() = default;
134
135 virtual TestFactoryBase* CreateTestFactory(ParamType parameter) {
136 return new ParameterizedTestFactory<TestCase>(parameter);
137
138=== modified file '3rd_party/gmock-1.6.0/gtest/include/gtest/internal/gtest-param-util.h'
139--- 3rd_party/gmock-1.6.0/gtest/include/gtest/internal/gtest-param-util.h 2012-08-08 08:07:55 +0000
140+++ 3rd_party/gmock-1.6.0/gtest/include/gtest/internal/gtest-param-util.h 2013-05-30 07:52:28 +0000
141@@ -373,7 +373,7 @@
142 template <class ParamType>
143 class TestMetaFactoryBase {
144 public:
145- virtual ~TestMetaFactoryBase() {}
146+ virtual ~TestMetaFactoryBase() = default;
147
148 virtual TestFactoryBase* CreateTestFactory(ParamType parameter) = 0;
149 };
150@@ -393,6 +393,7 @@
151 typedef typename TestCase::ParamType ParamType;
152
153 TestMetaFactory() {}
154+ virtual ~TestMetaFactory() = default;
155
156 virtual TestFactoryBase* CreateTestFactory(ParamType parameter) {
157 return new ParameterizedTestFactory<TestCase>(parameter);
158
159=== modified file '3rd_party/gmock-1.6.0/include/gmock/gmock-actions.h'
160--- 3rd_party/gmock-1.6.0/include/gmock/gmock-actions.h 2012-08-08 08:07:55 +0000
161+++ 3rd_party/gmock-1.6.0/include/gmock/gmock-actions.h 2013-05-30 07:52:28 +0000
162@@ -70,6 +70,7 @@
163 template <typename T>
164 class BuiltInDefaultValue {
165 public:
166+ virtual ~BuiltInDefaultValue() {}
167 // This function returns true iff type T has a built-in default value.
168 static bool Exists() { return false; }
169 static T Get() {
170@@ -86,6 +87,7 @@
171 template <typename T>
172 class BuiltInDefaultValue<const T> {
173 public:
174+ virtual ~BuiltInDefaultValue() {}
175 static bool Exists() { return BuiltInDefaultValue<T>::Exists(); }
176 static T Get() { return BuiltInDefaultValue<T>::Get(); }
177 };
178@@ -95,6 +97,7 @@
179 template <typename T>
180 class BuiltInDefaultValue<T*> {
181 public:
182+ virtual ~BuiltInDefaultValue() {}
183 static bool Exists() { return true; }
184 static T* Get() { return NULL; }
185 };
186@@ -105,6 +108,7 @@
187 template <> \
188 class BuiltInDefaultValue<type> { \
189 public: \
190+ virtual ~BuiltInDefaultValue() {} \
191 static bool Exists() { return true; } \
192 static type Get() { return value; } \
193 }
194@@ -160,6 +164,8 @@
195 template <typename T>
196 class DefaultValue {
197 public:
198+ virtual ~DefaultValue() {}
199+
200 // Sets the default value for type T; requires T to be
201 // copy-constructable and have a public destructor.
202 static void Set(T x) {
203@@ -198,6 +204,8 @@
204 template <typename T>
205 class DefaultValue<T&> {
206 public:
207+ virtual ~DefaultValue() {}
208+
209 // Sets the default value for type T&.
210 static void Set(T& x) { // NOLINT
211 address_ = &x;
212@@ -233,6 +241,8 @@
213 template <>
214 class DefaultValue<void> {
215 public:
216+ virtual ~DefaultValue() {}
217+
218 static bool Exists() { return true; }
219 static void Get() {}
220 };
221@@ -283,6 +293,7 @@
222 // Constructs a null Action. Needed for storing Action objects in
223 // STL containers.
224 Action() : impl_(NULL) {}
225+ virtual ~Action() {}
226
227 // Constructs an Action from its implementation. A NULL impl is
228 // used to represent the "do-default" action.
229@@ -350,6 +361,7 @@
230 class PolymorphicAction {
231 public:
232 explicit PolymorphicAction(const Impl& impl) : impl_(impl) {}
233+ virtual ~PolymorphicAction() {}
234
235 template <typename F>
236 operator Action<F>() const {
237@@ -364,6 +376,7 @@
238 typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
239
240 explicit MonomorphicImpl(const Impl& impl) : impl_(impl) {}
241+ virtual ~MonomorphicImpl() {}
242
243 virtual Result Perform(const ArgumentTuple& args) {
244 return impl_.template Perform<Result>(args);
245@@ -410,6 +423,7 @@
246 typedef typename internal::Function<F1>::ArgumentTuple ArgumentTuple;
247
248 explicit ActionAdaptor(const Action<F2>& from) : impl_(from.impl_) {}
249+ virtual ~ActionAdaptor() {}
250
251 virtual Result Perform(const ArgumentTuple& args) {
252 return impl_->Perform(args);
253@@ -452,6 +466,7 @@
254 // 'value' is passed by value instead of by const reference in order
255 // to allow Return("string literal") to compile.
256 explicit ReturnAction(R value) : value_(value) {}
257+ virtual ~ReturnAction() = default;
258
259 // This template type conversion operator allows Return(x) to be
260 // used in ANY function that returns x's type.
261@@ -477,6 +492,7 @@
262 template <typename F>
263 class Impl : public ActionInterface<F> {
264 public:
265+ virtual ~Impl() {}
266 typedef typename Function<F>::Result Result;
267 typedef typename Function<F>::ArgumentTuple ArgumentTuple;
268
269@@ -709,6 +725,7 @@
270 explicit SetArgumentPointeeAction(const Proto& proto) : proto_(new Proto) {
271 proto_->CopyFrom(proto);
272 }
273+ virtual ~SetArgumentPointeeAction() {}
274
275 template <typename Result, typename ArgumentTuple>
276 void Perform(const ArgumentTuple& args) const {
277@@ -734,6 +751,7 @@
278 // pointer or a functor).
279 explicit InvokeWithoutArgsAction(FunctionImpl function_impl)
280 : function_impl_(function_impl) {}
281+ virtual ~InvokeWithoutArgsAction() {}
282
283 // Allows InvokeWithoutArgs(f) to be used as any action whose type is
284 // compatible with f.
285@@ -752,6 +770,7 @@
286 public:
287 InvokeMethodWithoutArgsAction(Class* obj_ptr, MethodPtr method_ptr)
288 : obj_ptr_(obj_ptr), method_ptr_(method_ptr) {}
289+ virtual ~InvokeMethodWithoutArgsAction() {}
290
291 template <typename Result, typename ArgumentTuple>
292 Result Perform(const ArgumentTuple&) const {
293@@ -770,6 +789,7 @@
294 class IgnoreResultAction {
295 public:
296 explicit IgnoreResultAction(const A& action) : action_(action) {}
297+ virtual ~IgnoreResultAction() {}
298
299 template <typename F>
300 operator Action<F>() const {
301@@ -797,6 +817,7 @@
302 typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
303
304 explicit Impl(const A& action) : action_(action) {}
305+ virtual ~Impl() {}
306
307 virtual void Perform(const ArgumentTuple& args) {
308 // Performs the action and ignores its result.
309@@ -831,6 +852,7 @@
310 public:
311 // Constructs a ReferenceWrapper<T> object from a T&.
312 explicit ReferenceWrapper(T& l_value) : pointer_(&l_value) {} // NOLINT
313+ virtual ~ReferenceWrapper() {}
314
315 // Allows a ReferenceWrapper<T> object to be implicitly converted to
316 // a T&.
317@@ -853,6 +875,7 @@
318 public:
319 DoBothAction(Action1 action1, Action2 action2)
320 : action1_(action1), action2_(action2) {}
321+ virtual ~DoBothAction() {}
322
323 // This template type conversion operator allows DoAll(a1, ..., a_n)
324 // to be used in ANY function of compatible type.
325@@ -872,6 +895,7 @@
326
327 Impl(const Action<VoidResult>& action1, const Action<F>& action2)
328 : action1_(action1), action2_(action2) {}
329+ virtual ~Impl() {}
330
331 virtual Result Perform(const ArgumentTuple& args) {
332 action1_.Perform(args);
333
334=== modified file '3rd_party/gmock-1.6.0/include/gmock/gmock-generated-actions.h'
335--- 3rd_party/gmock-1.6.0/include/gmock/gmock-generated-actions.h 2012-08-08 08:07:55 +0000
336+++ 3rd_party/gmock-1.6.0/include/gmock/gmock-generated-actions.h 2013-05-30 07:52:28 +0000
337@@ -597,6 +597,8 @@
338 template <typename F>
339 class Impl : public ActionInterface<F> {
340 public:
341+ virtual ~Impl() {}
342+
343 typedef typename Function<F>::Result Result;
344 typedef typename Function<F>::ArgumentTuple ArgumentTuple;
345
346
347=== modified file '3rd_party/gmock-1.6.0/include/gmock/gmock-matchers.h'
348--- 3rd_party/gmock-1.6.0/include/gmock/gmock-matchers.h 2012-08-10 12:33:42 +0000
349+++ 3rd_party/gmock-1.6.0/include/gmock/gmock-matchers.h 2013-05-30 07:52:28 +0000
350@@ -336,6 +336,7 @@
351 class MonomorphicImpl : public MatcherInterface<T> {
352 public:
353 explicit MonomorphicImpl(const Impl& impl) : impl_(impl) {}
354+ virtual ~MonomorphicImpl() {}
355
356 virtual void DescribeTo(::std::ostream* os) const {
357 impl_.DescribeTo(os);
358@@ -704,6 +705,7 @@
359 template <typename Rhs> class name##Matcher { \
360 public: \
361 explicit name##Matcher(const Rhs& rhs) : rhs_(rhs) {} \
362+ virtual ~name##Matcher() {} \
363 template <typename Lhs> \
364 operator Matcher<Lhs>() const { \
365 return MakeMatcher(new Impl<Lhs>(rhs_)); \
366@@ -713,6 +715,7 @@
367 class Impl : public MatcherInterface<Lhs> { \
368 public: \
369 explicit Impl(const Rhs& rhs) : rhs_(rhs) {} \
370+ virtual ~Impl() {} \
371 virtual bool MatchAndExplain(\
372 Lhs lhs, MatchResultListener* /* listener */) const { \
373 return lhs op rhs_; \
374@@ -748,6 +751,8 @@
375 // pointer that is NULL.
376 class IsNullMatcher {
377 public:
378+ virtual ~IsNullMatcher() {}
379+
380 template <typename Pointer>
381 bool MatchAndExplain(const Pointer& p,
382 MatchResultListener* /* listener */) const {
383@@ -764,6 +769,7 @@
384 // pointer that is not NULL.
385 class NotNullMatcher {
386 public:
387+ virtual ~NotNullMatcher() {}
388 template <typename Pointer>
389 bool MatchAndExplain(const Pointer& p,
390 MatchResultListener* /* listener */) const {
391@@ -804,6 +810,7 @@
392 // compiler to catch using Ref(const_value) as a matcher for a
393 // non-const reference.
394 explicit RefMatcher(T& x) : object_(x) {} // NOLINT
395+ virtual ~RefMatcher() {}
396
397 template <typename Super>
398 operator Matcher<Super&>() const {
399@@ -820,6 +827,7 @@
400 class Impl : public MatcherInterface<Super&> {
401 public:
402 explicit Impl(Super& x) : object_(x) {} // NOLINT
403+ virtual ~Impl() {}
404
405 // MatchAndExplain() takes a Super& (as opposed to const Super&)
406 // in order to match the interface MatcherInterface<Super&>.
407@@ -889,6 +897,8 @@
408 template <typename StringType>
409 class StrEqualityMatcher {
410 public:
411+ virtual ~StrEqualityMatcher() {}
412+
413 typedef typename StringType::const_pointer ConstCharPointer;
414
415 StrEqualityMatcher(const StringType& str, bool expect_eq,
416@@ -948,6 +958,7 @@
417 explicit HasSubstrMatcher(const StringType& substring)
418 : substring_(substring) {}
419
420+ virtual ~HasSubstrMatcher() {}
421 // These overloaded methods allow HasSubstr(substring) to be used as a
422 // Matcher<T> as long as T can be converted to string. Returns true
423 // iff s contains substring_ as a substring.
424@@ -989,6 +1000,8 @@
425 explicit StartsWithMatcher(const StringType& prefix) : prefix_(prefix) {
426 }
427
428+ virtual ~StartsWithMatcher() {}
429+
430 // These overloaded methods allow StartsWith(prefix) to be used as a
431 // Matcher<T> as long as T can be converted to string. Returns true
432 // iff s starts with prefix_.
433@@ -1028,6 +1041,7 @@
434 typedef typename StringType::const_pointer ConstCharPointer;
435
436 explicit EndsWithMatcher(const StringType& suffix) : suffix_(suffix) {}
437+ virtual ~EndsWithMatcher() {}
438
439 // These overloaded methods allow EndsWith(suffix) to be used as a
440 // Matcher<T> as long as T can be converted to string. Returns true
441@@ -1067,6 +1081,8 @@
442 MatchesRegexMatcher(const RE* regex, bool full_match)
443 : regex_(regex), full_match_(full_match) {}
444
445+ virtual ~MatchesRegexMatcher() {}
446+
447 // These overloaded methods allow MatchesRegex(regex) to be used as
448 // a Matcher<T> as long as T can be converted to string. Returns
449 // true iff s matches regular expression regex. When full_match_ is
450@@ -1127,6 +1143,7 @@
451 template <typename Tuple> \
452 class Impl : public MatcherInterface<Tuple> { \
453 public: \
454+ virtual ~Impl() {} \
455 virtual bool MatchAndExplain( \
456 Tuple args, \
457 MatchResultListener* /* listener */) const { \
458@@ -1164,6 +1181,7 @@
459 public:
460 explicit NotMatcherImpl(const Matcher<T>& matcher)
461 : matcher_(matcher) {}
462+ virtual ~NotMatcherImpl() {}
463
464 virtual bool MatchAndExplain(T x, MatchResultListener* listener) const {
465 return !matcher_.MatchAndExplain(x, listener);
466@@ -1213,6 +1231,8 @@
467 BothOfMatcherImpl(const Matcher<T>& matcher1, const Matcher<T>& matcher2)
468 : matcher1_(matcher1), matcher2_(matcher2) {}
469
470+ virtual ~BothOfMatcherImpl() {}
471+
472 virtual void DescribeTo(::std::ostream* os) const {
473 *os << "(";
474 matcher1_.DescribeTo(os);
475@@ -1273,6 +1293,7 @@
476 public:
477 BothOfMatcher(Matcher1 matcher1, Matcher2 matcher2)
478 : matcher1_(matcher1), matcher2_(matcher2) {}
479+ virtual ~BothOfMatcher() {}
480
481 // This template type conversion operator allows a
482 // BothOfMatcher<Matcher1, Matcher2> object to match any type that
483@@ -1299,6 +1320,7 @@
484 public:
485 EitherOfMatcherImpl(const Matcher<T>& matcher1, const Matcher<T>& matcher2)
486 : matcher1_(matcher1), matcher2_(matcher2) {}
487+ virtual ~EitherOfMatcherImpl() {}
488
489 virtual void DescribeTo(::std::ostream* os) const {
490 *os << "(";
491@@ -1517,6 +1539,7 @@
492 // equality comparisons between NANs will always return false.
493 FloatingEqMatcher(FloatType rhs, bool nan_eq_nan) :
494 rhs_(rhs), nan_eq_nan_(nan_eq_nan) {}
495+ virtual ~FloatingEqMatcher() {}
496
497 // Implements floating point equality matcher as a Matcher<T>.
498 template <typename T>
499@@ -1609,6 +1632,7 @@
500 class PointeeMatcher {
501 public:
502 explicit PointeeMatcher(const InnerMatcher& matcher) : matcher_(matcher) {}
503+ virtual ~PointeeMatcher() {}
504
505 // This type conversion operator template allows Pointee(m) to be
506 // used as a matcher for any pointer type whose pointee type is
507@@ -1628,6 +1652,8 @@
508 template <typename Pointer>
509 class Impl : public MatcherInterface<Pointer> {
510 public:
511+ virtual ~Impl() {}
512+
513 typedef typename PointeeOf<GTEST_REMOVE_CONST_( // NOLINT
514 GTEST_REMOVE_REFERENCE_(Pointer))>::type Pointee;
515
516@@ -1824,6 +1850,7 @@
517 : callable_(callable), matcher_(matcher) {
518 CallableTraits<Callable>::CheckIsValid(callable_);
519 }
520+ virtual ~ResultOfMatcher() {}
521
522 template <typename T>
523 operator Matcher<T>() const {
524@@ -1838,6 +1865,7 @@
525 public:
526 Impl(CallableStorageType callable, const Matcher<ResultType>& matcher)
527 : callable_(callable), matcher_(matcher) {}
528+ virtual ~Impl() {}
529
530 virtual void DescribeTo(::std::ostream* os) const {
531 *os << "is mapped by the given callable to a value that ";
532@@ -1902,6 +1930,8 @@
533 GTEST_REMOVE_REFERENCE_AND_CONST_(Container)>();
534 }
535
536+ virtual ~ContainerEqMatcher() {}
537+
538 void DescribeTo(::std::ostream* os) const {
539 *os << "equals ";
540 UniversalPrint(rhs_, os);
541@@ -1990,6 +2020,7 @@
542 (void)testing::StaticAssertTypeEq<RhsContainer,
543 GTEST_REMOVE_REFERENCE_AND_CONST_(RhsContainer)>();
544 }
545+ virtual ~PointwiseMatcher() {}
546
547 template <typename LhsContainer>
548 operator Matcher<LhsContainer>() const {
549@@ -2014,6 +2045,7 @@
550 // mono_tuple_matcher_ holds a monomorphic version of the tuple matcher.
551 : mono_tuple_matcher_(SafeMatcherCast<InnerMatcherArg>(tuple_matcher)),
552 rhs_(rhs) {}
553+ virtual ~Impl() {}
554
555 virtual void DescribeTo(::std::ostream* os) const {
556 *os << "contains " << rhs_.size()
557@@ -2094,6 +2126,7 @@
558 explicit QuantifierMatcherImpl(InnerMatcher inner_matcher)
559 : inner_matcher_(
560 testing::SafeMatcherCast<const Element&>(inner_matcher)) {}
561+ virtual ~QuantifierMatcherImpl() {}
562
563 // Checks whether:
564 // * All elements in the container match, if all_elements_should_match.
565@@ -2132,6 +2165,7 @@
566 template <typename InnerMatcher>
567 explicit ContainsMatcherImpl(InnerMatcher inner_matcher)
568 : QuantifierMatcherImpl<Container>(inner_matcher) {}
569+ virtual ~ContainsMatcherImpl() {}
570
571 // Describes what this matcher does.
572 virtual void DescribeTo(::std::ostream* os) const {
573@@ -2161,6 +2195,7 @@
574 template <typename InnerMatcher>
575 explicit EachMatcherImpl(InnerMatcher inner_matcher)
576 : QuantifierMatcherImpl<Container>(inner_matcher) {}
577+ virtual ~EachMatcherImpl() {}
578
579 // Describes what this matcher does.
580 virtual void DescribeTo(::std::ostream* os) const {
581@@ -2187,6 +2222,7 @@
582 class ContainsMatcher {
583 public:
584 explicit ContainsMatcher(M m) : inner_matcher_(m) {}
585+ virtual ~ContainsMatcher() {}
586
587 template <typename Container>
588 operator Matcher<Container>() const {
589@@ -2204,6 +2240,7 @@
590 class EachMatcher {
591 public:
592 explicit EachMatcher(M m) : inner_matcher_(m) {}
593+ virtual ~EachMatcher() {}
594
595 template <typename Container>
596 operator Matcher<Container>() const {
597@@ -2231,6 +2268,7 @@
598 : inner_matcher_(
599 testing::SafeMatcherCast<const KeyType&>(inner_matcher)) {
600 }
601+ virtual ~KeyMatcherImpl() {}
602
603 // Returns true iff 'key_value.first' (the key) matches the inner matcher.
604 virtual bool MatchAndExplain(PairType key_value,
605@@ -2268,6 +2306,7 @@
606 class KeyMatcher {
607 public:
608 explicit KeyMatcher(M m) : matcher_for_key_(m) {}
609+ virtual ~KeyMatcher() {}
610
611 template <typename PairType>
612 operator Matcher<PairType>() const {
613@@ -2296,6 +2335,7 @@
614 second_matcher_(
615 testing::SafeMatcherCast<const SecondType&>(second_matcher)) {
616 }
617+ virtual ~PairMatcherImpl() {}
618
619 // Describes what this matcher does.
620 virtual void DescribeTo(::std::ostream* os) const {
621@@ -2373,6 +2413,7 @@
622 public:
623 PairMatcher(FirstMatcher first_matcher, SecondMatcher second_matcher)
624 : first_matcher_(first_matcher), second_matcher_(second_matcher) {}
625+ virtual ~PairMatcher() {}
626
627 template <typename PairType>
628 operator Matcher<PairType> () const {
629@@ -2409,6 +2450,8 @@
630 }
631 }
632
633+ virtual ~ElementsAreMatcherImpl() {}
634+
635 // Describes what this matcher does.
636 virtual void DescribeTo(::std::ostream* os) const {
637 if (count() == 0) {
638@@ -2526,6 +2569,7 @@
639 public:
640 ElementsAreArrayMatcher(const T* first, size_t count) :
641 first_(first), count_(count) {}
642+ virtual ~ElementsAreArrayMatcher() {}
643
644 template <typename Container>
645 operator Matcher<Container>() const {
646
647=== modified file 'include/server/mir/compositor/buffer_allocation_strategy.h'
648--- include/server/mir/compositor/buffer_allocation_strategy.h 2013-04-24 05:22:20 +0000
649+++ include/server/mir/compositor/buffer_allocation_strategy.h 2013-05-30 07:52:28 +0000
650@@ -36,13 +36,12 @@
651 class BufferAllocationStrategy
652 {
653 public:
654-
655 virtual std::unique_ptr<BufferSwapper> create_swapper(
656 BufferProperties& actual_buffer_properties,
657 BufferProperties const& requested_buffer_properties) = 0;
658
659 protected:
660- ~BufferAllocationStrategy() {}
661+ virtual ~BufferAllocationStrategy() = default;
662 BufferAllocationStrategy() {}
663
664 BufferAllocationStrategy(const BufferAllocationStrategy&);
665
666=== modified file 'include/server/mir/default_server_configuration.h'
667--- include/server/mir/default_server_configuration.h 2013-05-28 17:15:21 +0000
668+++ include/server/mir/default_server_configuration.h 2013-05-30 07:52:28 +0000
669@@ -101,6 +101,7 @@
670 {
671 public:
672 DefaultServerConfiguration(int argc, char const* argv[]);
673+ virtual ~DefaultServerConfiguration() noexcept {}
674
675 /** @name DisplayServer dependencies
676 * dependencies of DisplayServer on the rest of the Mir
677
678=== modified file 'include/server/mir/frontend/session_mediator_report.h'
679--- include/server/mir/frontend/session_mediator_report.h 2013-05-17 15:56:34 +0000
680+++ include/server/mir/frontend/session_mediator_report.h 2013-05-30 07:52:28 +0000
681@@ -30,6 +30,8 @@
682 class SessionMediatorReport
683 {
684 public:
685+ virtual ~SessionMediatorReport() = default;
686+
687 virtual void session_connect_called(std::string const& app_name) = 0;
688
689 virtual void session_create_surface_called(std::string const& app_name) = 0;
690
691=== modified file 'include/server/mir/graphics/display.h'
692--- include/server/mir/graphics/display.h 2013-04-30 23:12:18 +0000
693+++ include/server/mir/graphics/display.h 2013-05-30 07:52:28 +0000
694@@ -59,7 +59,7 @@
695
696 protected:
697 Display() = default;
698- ~Display() = default;
699+ virtual ~Display() noexcept {}
700 private:
701 Display(Display const&) = delete;
702 Display& operator=(Display const&) = delete;
703
704=== modified file 'include/server/mir/graphics/display_report.h'
705--- include/server/mir/graphics/display_report.h 2013-05-10 18:16:51 +0000
706+++ include/server/mir/graphics/display_report.h 2013-05-30 07:52:28 +0000
707@@ -46,7 +46,7 @@
708
709 protected:
710 DisplayReport() = default;
711- ~DisplayReport() = default;
712+ virtual ~DisplayReport() = default;
713 DisplayReport(const DisplayReport&) = delete;
714 DisplayReport& operator=(const DisplayReport&) = delete;
715 };
716
717=== modified file 'include/server/mir/graphics/platform.h'
718--- include/server/mir/graphics/platform.h 2013-05-17 18:18:20 +0000
719+++ include/server/mir/graphics/platform.h 2013-05-30 07:52:28 +0000
720@@ -54,6 +54,8 @@
721 Platform(const Platform& p) = delete;
722 Platform& operator=(const Platform& p) = delete;
723
724+ virtual ~Platform() = default;
725+
726 virtual std::shared_ptr<compositor::GraphicBufferAllocator> create_buffer_allocator(
727 std::shared_ptr<BufferInitializer> const& buffer_initializer) = 0;
728 virtual std::shared_ptr<Display> create_display() = 0;
729
730=== modified file 'include/server/mir/graphics/viewable_area.h'
731--- include/server/mir/graphics/viewable_area.h 2013-04-24 05:22:20 +0000
732+++ include/server/mir/graphics/viewable_area.h 2013-05-30 07:52:28 +0000
733@@ -34,7 +34,7 @@
734
735 protected:
736 ViewableArea() = default;
737- ~ViewableArea() = default;
738+ virtual ~ViewableArea() = default;
739 private:
740 ViewableArea(ViewableArea const&) = delete;
741 ViewableArea& operator=(ViewableArea const&) = delete;
742
743=== modified file 'include/server/mir/logging/display_report.h'
744--- include/server/mir/logging/display_report.h 2013-05-10 18:16:51 +0000
745+++ include/server/mir/logging/display_report.h 2013-05-30 07:52:28 +0000
746@@ -37,7 +37,7 @@
747 static const char* component();
748
749 DisplayReport(const std::shared_ptr<Logger>& logger);
750- virtual ~DisplayReport();
751+ virtual ~DisplayReport() noexcept;
752
753 virtual void report_successful_setup_of_native_resources();
754 virtual void report_successful_egl_make_current_on_construction();
755
756=== modified file 'include/server/mir/options/option.h'
757--- include/server/mir/options/option.h 2013-04-24 05:22:20 +0000
758+++ include/server/mir/options/option.h 2013-05-30 07:52:28 +0000
759@@ -39,7 +39,7 @@
760
761 protected:
762 Option() = default;
763- ~Option() = default;
764+ virtual ~Option() = default;
765 Option(Option const&) = delete;
766 Option& operator=(Option const&) = delete;
767 };
768
769=== modified file 'include/server/mir/options/program_option.h'
770--- include/server/mir/options/program_option.h 2013-04-24 05:22:20 +0000
771+++ include/server/mir/options/program_option.h 2013-05-30 07:52:28 +0000
772@@ -33,6 +33,7 @@
773 {
774 public:
775 ProgramOption();
776+ virtual ~ProgramOption() noexcept;
777
778 void parse_arguments(
779 boost::program_options::options_description const& description,
780
781=== modified file 'include/server/mir/server_configuration.h'
782--- include/server/mir/server_configuration.h 2013-04-25 09:48:54 +0000
783+++ include/server/mir/server_configuration.h 2013-05-30 07:52:28 +0000
784@@ -60,7 +60,7 @@
785
786 protected:
787 ServerConfiguration() = default;
788- virtual ~ServerConfiguration() {}
789+ virtual ~ServerConfiguration() = default;
790
791 ServerConfiguration(ServerConfiguration const&) = delete;
792 ServerConfiguration& operator=(ServerConfiguration const&) = delete;
793
794=== modified file 'include/server/mir/surfaces/buffer_bundle.h'
795--- include/server/mir/surfaces/buffer_bundle.h 2013-04-24 05:22:20 +0000
796+++ include/server/mir/surfaces/buffer_bundle.h 2013-05-30 07:52:28 +0000
797@@ -40,6 +40,8 @@
798 class BufferBundle
799 {
800 public:
801+ ~BufferBundle() = default;
802+
803 virtual std::shared_ptr<compositor::Buffer> secure_client_buffer() = 0;
804 virtual std::shared_ptr<surfaces::GraphicRegion> lock_back_buffer() = 0;
805 virtual geometry::PixelFormat get_bundle_pixel_format() = 0;
806
807=== modified file 'include/test/mir_test_doubles/mock_android_alloc_device.h'
808--- include/test/mir_test_doubles/mock_android_alloc_device.h 2013-05-01 17:35:49 +0000
809+++ include/test/mir_test_doubles/mock_android_alloc_device.h 2013-05-30 07:52:28 +0000
810@@ -30,6 +30,7 @@
811 class ICSAllocInterface
812 {
813 public:
814+ virtual ~ICSAllocInterface() = default;
815 virtual int alloc_interface(alloc_device_t* dev, int w, int h,
816 int format, int usage, buffer_handle_t* handle, int* stride) = 0;
817 virtual int free_interface(alloc_device_t* dev, buffer_handle_t handle) = 0;
818
819=== modified file 'include/test/mir_test_doubles/mock_display_report.h'
820--- include/test/mir_test_doubles/mock_display_report.h 2013-05-10 18:16:51 +0000
821+++ include/test/mir_test_doubles/mock_display_report.h 2013-05-30 07:52:28 +0000
822@@ -33,6 +33,8 @@
823 class MockDisplayReport : public graphics::DisplayReport
824 {
825 public:
826+ virtual ~MockDisplayReport() noexcept {}
827+
828 MOCK_METHOD0(report_successful_setup_of_native_resources, void());
829 MOCK_METHOD0(report_successful_egl_make_current_on_construction, void());
830 MOCK_METHOD0(report_successful_egl_buffer_swap_on_construction, void());
831
832=== modified file 'include/test/mir_test_doubles/mock_viewable_area.h'
833--- include/test/mir_test_doubles/mock_viewable_area.h 2013-04-24 05:22:20 +0000
834+++ include/test/mir_test_doubles/mock_viewable_area.h 2013-05-30 07:52:28 +0000
835@@ -33,6 +33,7 @@
836 struct MockViewableArea : public graphics::ViewableArea
837 {
838 public:
839+ virtual ~MockViewableArea() noexcept {}
840 MOCK_CONST_METHOD0(view_area, geometry::Rectangle ());
841 };
842
843
844=== modified file 'include/test/mir_test_framework/testing_process_manager.h'
845--- include/test/mir_test_framework/testing_process_manager.h 2013-04-24 05:22:20 +0000
846+++ include/test/mir_test_framework/testing_process_manager.h 2013-05-30 07:52:28 +0000
847@@ -40,6 +40,7 @@
848
849 struct TestingClientConfiguration
850 {
851+ virtual ~TestingClientConfiguration() = default;
852 // Code to run in client process
853 virtual void exec() = 0;
854 };
855
856=== modified file 'include/test/mir_test_framework/testing_server_configuration.h'
857--- include/test/mir_test_framework/testing_server_configuration.h 2013-05-02 00:11:18 +0000
858+++ include/test/mir_test_framework/testing_server_configuration.h 2013-05-30 07:52:28 +0000
859@@ -35,6 +35,7 @@
860 {
861 public:
862 TestingServerConfiguration();
863+ virtual ~TestingServerConfiguration() noexcept {}
864
865 // Code to run in server process
866 virtual void exec();
867
868=== modified file 'src/client/android/android_client_buffer.cpp'
869--- src/client/android/android_client_buffer.cpp 2013-05-03 22:53:42 +0000
870+++ src/client/android/android_client_buffer.cpp 2013-05-30 07:52:28 +0000
871@@ -41,6 +41,10 @@
872 pack_native_window_buffer();
873 }
874
875+mcla::AndroidClientBuffer::~AndroidClientBuffer()
876+{
877+}
878+
879 static void incRef(android_native_base_t*)
880 {
881 }
882
883=== modified file 'src/client/android/android_registrar.h'
884--- src/client/android/android_registrar.h 2013-04-24 05:22:20 +0000
885+++ src/client/android/android_registrar.h 2013-05-30 07:52:28 +0000
886@@ -35,6 +35,8 @@
887 class AndroidRegistrar
888 {
889 public:
890+ virtual ~AndroidRegistrar() = default;
891+
892 virtual void register_buffer(const native_handle_t *handle) = 0;
893 virtual void unregister_buffer(const native_handle_t *handle) = 0;
894 virtual std::shared_ptr<char> secure_for_cpu(std::shared_ptr<const native_handle_t> handle, const geometry::Rectangle) = 0;
895
896=== modified file 'src/client/client_platform.h'
897--- src/client/client_platform.h 2013-05-03 18:39:57 +0000
898+++ src/client/client_platform.h 2013-05-30 07:52:28 +0000
899@@ -38,6 +38,8 @@
900 ClientPlatform(const ClientPlatform& p) = delete;
901 ClientPlatform& operator=(const ClientPlatform& p) = delete;
902
903+ virtual ~ClientPlatform() = default;
904+
905 virtual MirPlatformType platform_type() const = 0;
906 virtual std::shared_ptr<ClientBufferFactory> create_buffer_factory() = 0;
907 virtual std::shared_ptr<EGLNativeWindowType> create_egl_native_window(ClientSurface *surface) = 0;
908
909=== modified file 'src/server/frontend/message_processor.h'
910--- src/server/frontend/message_processor.h 2013-04-24 05:22:20 +0000
911+++ src/server/frontend/message_processor.h 2013-05-30 07:52:28 +0000
912@@ -37,7 +37,7 @@
913 virtual void send_fds(std::vector<int32_t> const& fd) = 0;
914 protected:
915 MessageSender() = default;
916- ~MessageSender() = default;
917+ virtual ~MessageSender() = default;
918 MessageSender(MessageSender const&) = delete;
919 MessageSender& operator=(MessageSender const&) = delete;
920 };
921
922=== modified file 'src/server/frontend/socket_session.cpp'
923--- src/server/frontend/socket_session.cpp 2013-04-24 05:22:20 +0000
924+++ src/server/frontend/socket_session.cpp 2013-05-30 07:52:28 +0000
925@@ -27,7 +27,6 @@
926
927 namespace mfd = mir::frontend::detail;
928
929-
930 void mfd::SocketSession::send(std::string const& body)
931 {
932 const size_t size = body.size();
933
934=== modified file 'src/server/frontend/socket_session.h'
935--- src/server/frontend/socket_session.h 2013-04-24 05:22:20 +0000
936+++ src/server/frontend/socket_session.h 2013-05-30 07:52:28 +0000
937@@ -43,6 +43,8 @@
938 connected_sessions(connected_sessions),
939 processor(std::make_shared<NullMessageProcessor>()) {}
940
941+ virtual ~SocketSession() noexcept {}
942+
943 int id() const { return id_; }
944
945 void read_next_message();
946
947=== modified file 'src/server/graphics/gbm/gbm_display.cpp'
948--- src/server/graphics/gbm/gbm_display.cpp 2013-05-13 09:23:04 +0000
949+++ src/server/graphics/gbm/gbm_display.cpp 2013-05-30 07:52:28 +0000
950@@ -64,7 +64,8 @@
951 shared_egl.make_current();
952 }
953
954-mgg::GBMDisplay::~GBMDisplay()
955+//do not remove this empty destructor (unique_ptr)
956+mgg::GBMDisplay::~GBMDisplay() noexcept
957 {
958 }
959
960
961=== modified file 'src/server/graphics/gbm/gbm_display.h'
962--- src/server/graphics/gbm/gbm_display.h 2013-05-03 22:08:24 +0000
963+++ src/server/graphics/gbm/gbm_display.h 2013-05-30 07:52:28 +0000
964@@ -50,7 +50,7 @@
965 public:
966 GBMDisplay(std::shared_ptr<GBMPlatform> const& platform,
967 std::shared_ptr<DisplayReport> const& listener);
968- ~GBMDisplay();
969+ ~GBMDisplay() noexcept;
970
971 geometry::Rectangle view_area() const;
972 void for_each_display_buffer(std::function<void(DisplayBuffer&)> const& f);
973
974=== modified file 'src/server/graphics/gbm/gbm_platform.cpp'
975--- src/server/graphics/gbm/gbm_platform.cpp 2013-05-23 13:01:05 +0000
976+++ src/server/graphics/gbm/gbm_platform.cpp 2013-05-30 07:52:28 +0000
977@@ -17,7 +17,6 @@
978 */
979
980 #include "gbm_platform.h"
981-
982 #include "gbm_buffer_allocator.h"
983 #include "gbm_display.h"
984 #include "internal_client.h"
985@@ -88,7 +87,7 @@
986 internal_display_clients_present = false;
987 }
988
989-mgg::GBMPlatform::~GBMPlatform()
990+mgg::GBMPlatform::~GBMPlatform() noexcept
991 {
992 internal_native_display.reset();
993 internal_display_clients_present = false;
994
995=== modified file 'src/server/graphics/gbm/gbm_platform.h'
996--- src/server/graphics/gbm/gbm_platform.h 2013-05-20 17:09:41 +0000
997+++ src/server/graphics/gbm/gbm_platform.h 2013-05-30 07:52:28 +0000
998@@ -39,7 +39,7 @@
999 public:
1000 explicit GBMPlatform(std::shared_ptr<DisplayReport> const& reporter,
1001 std::shared_ptr<VirtualTerminal> const& vt);
1002- ~GBMPlatform();
1003+ ~GBMPlatform() noexcept;
1004
1005 /* From Platform */
1006 std::shared_ptr<compositor::GraphicBufferAllocator> create_buffer_allocator(
1007
1008=== modified file 'src/server/logging/display_report.cpp'
1009--- src/server/logging/display_report.cpp 2013-05-10 18:26:22 +0000
1010+++ src/server/logging/display_report.cpp 2013-05-30 07:52:28 +0000
1011@@ -28,7 +28,7 @@
1012 {
1013 }
1014
1015-ml::DisplayReport::~DisplayReport()
1016+ml::DisplayReport::~DisplayReport() noexcept
1017 {
1018 }
1019
1020
1021=== modified file 'src/server/options/program_option.cpp'
1022--- src/server/options/program_option.cpp 2013-04-30 23:28:00 +0000
1023+++ src/server/options/program_option.cpp 2013-05-30 07:52:28 +0000
1024@@ -30,6 +30,10 @@
1025 {
1026 }
1027
1028+mo::ProgramOption::~ProgramOption() noexcept
1029+{
1030+}
1031+
1032 void mo::ProgramOption::parse_arguments(
1033 po::options_description const& desc,
1034 int argc,
1035
1036=== modified file 'tests/acceptance-tests/test_client_input.cpp'
1037--- tests/acceptance-tests/test_client_input.cpp 2013-05-28 17:15:21 +0000
1038+++ tests/acceptance-tests/test_client_input.cpp 2013-05-30 07:52:28 +0000
1039@@ -64,6 +64,8 @@
1040 {
1041
1042 }
1043+
1044+ virtual ~FocusNotifyingDispatcherController() noexcept {}
1045
1046 void focus_changed(std::shared_ptr<mi::SurfaceTarget> const& surface) override
1047 {
1048@@ -85,6 +87,8 @@
1049 {
1050 }
1051
1052+ virtual ~FakeInputServerConfiguration() noexcept {}
1053+
1054 virtual void inject_input()
1055 {
1056 }
1057
1058=== modified file 'tests/integration-tests/compositor/multithread_harness.h'
1059--- tests/integration-tests/compositor/multithread_harness.h 2013-01-11 23:47:40 +0000
1060+++ tests/integration-tests/compositor/multithread_harness.h 2013-05-30 07:52:28 +0000
1061@@ -32,6 +32,8 @@
1062 class SynchronizerController
1063 {
1064 public:
1065+ virtual ~SynchronizerController() = default;
1066+
1067 virtual void ensure_child_is_waiting() = 0;
1068 virtual void activate_waiting_child() = 0;
1069 virtual void kill_thread() = 0;
1070@@ -41,6 +43,7 @@
1071 class SynchronizerSpawned
1072 {
1073 public:
1074+ virtual ~SynchronizerSpawned() = default;
1075 virtual bool child_enter_wait() = 0;
1076 virtual bool child_check_wait_request() = 0;
1077 };
1078@@ -56,9 +59,7 @@
1079 {
1080 };
1081
1082- ~Synchronizer ()
1083- {
1084- };
1085+ virtual ~Synchronizer () noexcept {}
1086
1087 void ensure_child_is_waiting()
1088 {
1089
1090=== modified file 'tests/integration-tests/frontend/test_application_mediator_report.cpp'
1091--- tests/integration-tests/frontend/test_application_mediator_report.cpp 2013-04-24 05:22:20 +0000
1092+++ tests/integration-tests/frontend/test_application_mediator_report.cpp 2013-05-30 07:52:28 +0000
1093@@ -50,6 +50,7 @@
1094 EXPECT_CALL(*this, session_disconnect_called(testing::_)).
1095 Times(testing::AtLeast(0));
1096 }
1097+ virtual ~MockApplicationMediatorReport() noexcept {}
1098
1099 MOCK_METHOD1(session_connect_called, void (std::string const&));
1100 MOCK_METHOD1(session_create_surface_called, void (std::string const&));
1101@@ -67,6 +68,8 @@
1102 {
1103 struct Server : TestingServerConfiguration
1104 {
1105+ virtual ~Server() noexcept {}
1106+
1107 std::shared_ptr<mf::SessionMediatorReport>
1108 the_application_mediator_report()
1109 {
1110@@ -83,6 +86,7 @@
1111
1112 struct Client: TestingClientConfiguration
1113 {
1114+ virtual ~Client() noexcept {}
1115 void exec()
1116 {
1117 mt::TestProtobufClient client(mtf::test_socket_file(), rpc_timeout_ms);
1118@@ -108,6 +112,7 @@
1119 {
1120 struct Server : TestingServerConfiguration
1121 {
1122+ virtual ~Server() noexcept {}
1123 std::shared_ptr<mf::SessionMediatorReport>
1124 the_application_mediator_report()
1125 {
1126@@ -124,6 +129,7 @@
1127
1128 struct Client: TestingClientConfiguration
1129 {
1130+ virtual ~Client() noexcept {}
1131 void exec()
1132 {
1133 mt::TestProtobufClient client(mtf::test_socket_file(), rpc_timeout_ms);
1134@@ -159,6 +165,7 @@
1135 {
1136 struct Server : TestingServerConfiguration
1137 {
1138+ virtual ~Server() noexcept {}
1139 std::shared_ptr<mf::SessionMediatorReport>
1140 the_application_mediator_report()
1141 {
1142@@ -175,6 +182,7 @@
1143
1144 struct Client: TestingClientConfiguration
1145 {
1146+ virtual ~Client() noexcept {}
1147 void exec()
1148 {
1149 mt::TestProtobufClient client(mtf::test_socket_file(), rpc_timeout_ms);
1150@@ -216,6 +224,7 @@
1151 {
1152 struct Server : TestingServerConfiguration
1153 {
1154+ virtual ~Server() noexcept {}
1155 std::shared_ptr<mf::SessionMediatorReport>
1156 the_application_mediator_report()
1157 {
1158@@ -232,6 +241,7 @@
1159
1160 struct Client: TestingClientConfiguration
1161 {
1162+ virtual ~Client() noexcept {}
1163 void exec()
1164 {
1165 mt::TestProtobufClient client(mtf::test_socket_file(), rpc_timeout_ms);
1166@@ -282,6 +292,7 @@
1167 {
1168 struct Server : TestingServerConfiguration
1169 {
1170+ virtual ~Server() noexcept {}
1171 std::shared_ptr<mf::SessionMediatorReport>
1172 the_application_mediator_report()
1173 {
1174@@ -298,6 +309,7 @@
1175
1176 struct Client: TestingClientConfiguration
1177 {
1178+ virtual ~Client() noexcept {}
1179 void exec()
1180 {
1181 mt::TestProtobufClient client(mtf::test_socket_file(), rpc_timeout_ms);
1182
1183=== modified file 'tests/integration-tests/test_display_server_main_loop_events.cpp'
1184--- tests/integration-tests/test_display_server_main_loop_events.cpp 2013-05-01 21:55:49 +0000
1185+++ tests/integration-tests/test_display_server_main_loop_events.cpp 2013-05-30 07:52:28 +0000
1186@@ -66,6 +66,8 @@
1187 {
1188 }
1189
1190+ virtual ~MockDisplay() noexcept {}
1191+
1192 mir::geometry::Rectangle view_area() const
1193 {
1194 return display->view_area();
1195@@ -107,6 +109,8 @@
1196 class ServerConfig : public mtf::TestingServerConfiguration
1197 {
1198 public:
1199+ virtual ~ServerConfig() noexcept {}
1200+
1201 std::shared_ptr<mi::InputManager> the_input_manager() override
1202 {
1203 if (!mock_input_manager)
1204
1205=== modified file 'tests/integration-tests/test_surface_first_frame_sync.cpp'
1206--- tests/integration-tests/test_surface_first_frame_sync.cpp 2013-05-21 15:11:41 +0000
1207+++ tests/integration-tests/test_surface_first_frame_sync.cpp 2013-05-30 07:52:28 +0000
1208@@ -57,6 +57,8 @@
1209 {
1210 }
1211
1212+ virtual ~SynchronousCompositor() {}
1213+
1214 void start()
1215 {
1216 renderables->set_change_callback([this]()
1217@@ -87,6 +89,8 @@
1218 {
1219 }
1220
1221+ virtual ~StubRenderer() noexcept {}
1222+
1223 void clear() {}
1224
1225 void render(std::function<void(std::shared_ptr<void> const&)>, mg::Renderable&)
1226@@ -103,6 +107,8 @@
1227 class StubDisplayBuffer : public mg::DisplayBuffer
1228 {
1229 public:
1230+ virtual ~StubDisplayBuffer() {}
1231+
1232 geom::Rectangle view_area() const
1233 {
1234 return geom::Rectangle{geom::Point(),
1235@@ -118,6 +124,8 @@
1236 class StubDisplay : public mg::Display
1237 {
1238 public:
1239+ virtual ~StubDisplay() noexcept {}
1240+
1241 geom::Rectangle view_area() const
1242 {
1243 return display_buffer.view_area();
1244@@ -180,7 +188,7 @@
1245 }
1246 }
1247
1248- ~ServerConfig()
1249+ virtual ~ServerConfig() noexcept
1250 {
1251 if (rendering_ops_pipe[0] >= 0)
1252 close(rendering_ops_pipe[0]);
1253
1254=== modified file 'tests/integration-tests/test_surfaceloop.cpp'
1255--- tests/integration-tests/test_surfaceloop.cpp 2013-05-24 15:44:11 +0000
1256+++ tests/integration-tests/test_surfaceloop.cpp 2013-05-30 07:52:28 +0000
1257@@ -67,6 +67,8 @@
1258 .WillByDefault(testing::Invoke(this, &MockBufferAllocationStrategy::on_create_swapper));
1259 }
1260
1261+ virtual ~MockBufferAllocationStrategy() noexcept {}
1262+
1263 MOCK_METHOD2(
1264 create_swapper,
1265 std::unique_ptr<mc::BufferSwapper>(mc::BufferProperties&, mc::BufferProperties const&));
1266@@ -93,6 +95,8 @@
1267 .WillByDefault(testing::Invoke(this, &MockGraphicBufferAllocator::on_create_swapper));
1268 }
1269
1270+ virtual ~MockGraphicBufferAllocator() noexcept {}
1271+
1272 MOCK_METHOD1(
1273 alloc_buffer,
1274 std::shared_ptr<mc::Buffer> (mc::BufferProperties const&));
1275@@ -121,6 +125,8 @@
1276 class StubDisplay : public mg::Display
1277 {
1278 public:
1279+ virtual ~StubDisplay() noexcept {}
1280+
1281 geom::Rectangle view_area() const
1282 {
1283 return default_view_area;
1284
1285=== modified file 'tests/unit-tests/client/android/test_client_android_registrar.cpp'
1286--- tests/unit-tests/client/android/test_client_android_registrar.cpp 2013-04-24 05:22:20 +0000
1287+++ tests/unit-tests/client/android/test_client_android_registrar.cpp 2013-05-30 07:52:28 +0000
1288@@ -33,6 +33,8 @@
1289 class ICSRegistrarInterface
1290 {
1291 public:
1292+ virtual ~ICSRegistrarInterface() = default;
1293+
1294 virtual int registerBuffer_interface(struct gralloc_module_t const* module, buffer_handle_t handle) const = 0;
1295 virtual int unregisterBuffer_interface(struct gralloc_module_t const* module, buffer_handle_t handle) const = 0;
1296 virtual int lock_interface(struct gralloc_module_t const* module, buffer_handle_t handle,
1297
1298=== modified file 'tests/unit-tests/client/test_mir_connection.cpp'
1299--- tests/unit-tests/client/test_mir_connection.cpp 2013-05-29 12:04:04 +0000
1300+++ tests/unit-tests/client/test_mir_connection.cpp 2013-05-30 07:52:28 +0000
1301@@ -41,6 +41,8 @@
1302
1303 struct MockRpcChannel : public mir::client::rpc::MirBasicRpcChannel
1304 {
1305+ virtual ~MockRpcChannel() noexcept {}
1306+
1307 void CallMethod(const google::protobuf::MethodDescriptor* method,
1308 google::protobuf::RpcController*,
1309 const google::protobuf::Message* parameters,
1310@@ -75,6 +77,8 @@
1311 .WillByDefault(Return(native_display));
1312 }
1313
1314+ virtual ~MockClientPlatform() noexcept {}
1315+
1316 MOCK_CONST_METHOD0(platform_type, MirPlatformType());
1317 MOCK_METHOD0(create_buffer_factory, std::shared_ptr<mcl::ClientBufferFactory>());
1318 MOCK_METHOD1(create_egl_native_window, std::shared_ptr<EGLNativeWindowType>(mcl::ClientSurface*));
1319
1320=== modified file 'tests/unit-tests/compositor/test_buffer_manager.cpp'
1321--- tests/unit-tests/compositor/test_buffer_manager.cpp 2013-01-23 01:03:20 +0000
1322+++ tests/unit-tests/compositor/test_buffer_manager.cpp 2013-05-30 07:52:28 +0000
1323@@ -37,6 +37,8 @@
1324
1325 struct MockBufferAllocationStrategy : public mc::BufferAllocationStrategy
1326 {
1327+ virtual ~MockBufferAllocationStrategy() noexcept {}
1328+
1329 MOCK_METHOD2(
1330 create_swapper,
1331 std::unique_ptr<mc::BufferSwapper>(mc::BufferProperties&, mc::BufferProperties const&));
1332
1333=== modified file 'tests/unit-tests/frontend/test_session_mediator.cpp'
1334--- tests/unit-tests/frontend/test_session_mediator.cpp 2013-05-24 15:44:11 +0000
1335+++ tests/unit-tests/frontend/test_session_mediator.cpp 2013-05-30 07:52:28 +0000
1336@@ -119,6 +119,8 @@
1337 .WillByDefault(Return(std::make_shared<mg::PlatformIPCPackage>()));
1338 }
1339
1340+ virtual ~MockPlatform() noexcept {}
1341+
1342 MOCK_METHOD1(create_buffer_allocator, std::shared_ptr<mc::GraphicBufferAllocator>(std::shared_ptr<mg::BufferInitializer> const&));
1343 MOCK_METHOD0(create_display, std::shared_ptr<mg::Display>());
1344 MOCK_METHOD0(get_ipc_package, std::shared_ptr<mg::PlatformIPCPackage>());
1345
1346=== modified file 'tests/unit-tests/graphics/android/test_android_framebuffer_window.cpp'
1347--- tests/unit-tests/graphics/android/test_android_framebuffer_window.cpp 2013-05-20 15:55:48 +0000
1348+++ tests/unit-tests/graphics/android/test_android_framebuffer_window.cpp 2013-05-30 07:52:28 +0000
1349@@ -31,6 +31,7 @@
1350 class ANativeWindowInterface
1351 {
1352 public:
1353+ virtual ~ANativeWindowInterface() = default;
1354 virtual int query_interface(const ANativeWindow* win , int code, int* value) const = 0;
1355 };
1356
1357
1358=== modified file 'tests/unit-tests/shell/test_consuming_placement_strategy.cpp'
1359--- tests/unit-tests/shell/test_consuming_placement_strategy.cpp 2013-05-21 17:16:43 +0000
1360+++ tests/unit-tests/shell/test_consuming_placement_strategy.cpp 2013-05-30 07:52:28 +0000
1361@@ -36,6 +36,8 @@
1362
1363 struct ConsumingPlacementStrategySetup : public testing::Test
1364 {
1365+ virtual ~ConsumingPlacementStrategySetup() noexcept {}
1366+
1367 void SetUp()
1368 {
1369 using namespace ::testing;
1370
1371=== modified file 'tests/unit-tests/test_gmock_fixes.cpp'
1372--- tests/unit-tests/test_gmock_fixes.cpp 2012-07-12 14:11:36 +0000
1373+++ tests/unit-tests/test_gmock_fixes.cpp 2013-05-30 07:52:28 +0000
1374@@ -26,11 +26,13 @@
1375 {
1376 struct Interface
1377 {
1378+ virtual ~Interface() = default;
1379 virtual std::unique_ptr<int> function() const = 0;
1380 };
1381
1382 struct MockImplementation : Interface
1383 {
1384+ virtual ~MockImplementation() noexcept {}
1385 MOCK_CONST_METHOD0(function, std::unique_ptr<int>());
1386 };
1387

Subscribers

People subscribed via source and target branches