From 98bd9cb8c9f370c977dc3b6cc14f3d1ebfd24563 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Fri, 8 Feb 2019 00:24:14 +0200 Subject: libcamera: signal: Disconnect signal automatically on slot deletion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a signal is connected to a member function slot, the slot is not disconnected when the slot object is deleted. This can lead to calling a member function of a deleted object if the signal isn't disconnected manually by the slot object's destructor. Make signal handling easier by implementing a base Object class that tracks all connected signals and disconnects from them automatically when the object is deleted, using template specialization resolution in the Signal class. As inheriting from the Object class may to a too harsh requirement for Signal usage in applications, keep the existing behaviour working if the slot doesn't inherit from the Object class. We may reconsider this later and require all slot objects to inherit from the Object class. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund --- Documentation/Doxyfile.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/Doxyfile.in b/Documentation/Doxyfile.in index b78fb3a0..3e2b7fd9 100644 --- a/Documentation/Doxyfile.in +++ b/Documentation/Doxyfile.in @@ -860,7 +860,9 @@ EXCLUDE_PATTERNS = # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories use the pattern */test/* -EXCLUDE_SYMBOLS = libcamera::SlotBase \ +EXCLUDE_SYMBOLS = libcamera::SignalBase \ + libcamera::SlotArgs \ + libcamera::SlotBase \ libcamera::SlotMember \ libcamera::SlotStatic -- cgit v1.2.1