From 5cba3372881994b5afa96449237aab80cc424e6d Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 7 Jul 2016 09:15:20 +0200 Subject: Less memory leaking with unique_ptr --- common/listener.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'common/listener.h') diff --git a/common/listener.h b/common/listener.h index 5e376c7..67d76e9 100644 --- a/common/listener.h +++ b/common/listener.h @@ -81,17 +81,17 @@ private: bool processClientBuffer(Client &client); void sendCommandCompleted(QLocalSocket *socket, uint messageId, bool success); void updateClientsWithRevision(qint64); - Sink::Resource *loadResource(); + Sink::Resource &loadResource(); void readFromSocket(QLocalSocket *socket); qint64 lowerBoundRevision(); - QLocalServer *m_server; + std::unique_ptr m_server; QVector m_connections; flatbuffers::FlatBufferBuilder m_fbb; const QByteArray m_resourceName; const QByteArray m_resourceInstanceIdentifier; - Sink::Resource *m_resource; - QTimer *m_clientBufferProcessesTimer; - QTimer *m_checkConnectionsTimer; + std::unique_ptr m_resource; + std::unique_ptr m_clientBufferProcessesTimer; + std::unique_ptr m_checkConnectionsTimer; int m_messageId; }; -- cgit v1.2.3 From da2b049e248c1ad7efeb53685158a205335e4e36 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 7 Jul 2016 22:23:49 +0200 Subject: A new debug system. Instead of a single #define as debug area the new system allows for an identifier for each debug message with the structure component.area. The component is a dot separated identifier of the runtime component, such as the process or the plugin. The area is the code component, and can be as such defined at compiletime. The idea of this system is that it becomes possible to i.e. look at the output of all messages in the query subsystem of a specific resource (something that happens in the client process, but in the resource-specific subcomponent). The new macros are supposed to be less likely to clash with other names, hence the new names. --- common/listener.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'common/listener.h') diff --git a/common/listener.h b/common/listener.h index 67d76e9..d6c537a 100644 --- a/common/listener.h +++ b/common/listener.h @@ -25,6 +25,7 @@ #include #include #include +#include namespace Sink { class Resource; @@ -54,6 +55,7 @@ public: class SINK_EXPORT Listener : public QObject { Q_OBJECT + SINK_DEBUG_AREA("communication") public: Listener(const QByteArray &resourceName, const QByteArray &resourceType, QObject *parent = 0); -- cgit v1.2.3