Changeset View
Changeset View
Standalone View
Standalone View
src/server/connection.cpp
Show All 27 Lines | |||||
28 | #include <QThreadStorage> | 28 | #include <QThreadStorage> | ||
29 | 29 | | |||
30 | #include "storage/datastore.h" | 30 | #include "storage/datastore.h" | ||
31 | #include "storage/dbdeadlockcatcher.h" | 31 | #include "storage/dbdeadlockcatcher.h" | ||
32 | #include "handler.h" | 32 | #include "handler.h" | ||
33 | #include "notificationmanager.h" | 33 | #include "notificationmanager.h" | ||
34 | 34 | | |||
35 | #include "tracer.h" | 35 | #include "tracer.h" | ||
36 | #include "collectionreferencemanager.h" | | |||
37 | 36 | | |||
38 | #include <cassert> | 37 | #include <cassert> | ||
39 | 38 | | |||
40 | #ifndef Q_OS_WIN | 39 | #ifndef Q_OS_WIN | ||
41 | #include <cxxabi.h> | 40 | #include <cxxabi.h> | ||
42 | #endif | 41 | #endif | ||
43 | 42 | | |||
44 | #include <QElapsedTimer> | 43 | #include <QElapsedTimer> | ||
▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Line(s) | |||||
116 | { | 115 | { | ||
117 | if (QThread::currentThread()->loopLevel() > 1) { | 116 | if (QThread::currentThread()->loopLevel() > 1) { | ||
118 | m_connectionClosing = true; | 117 | m_connectionClosing = true; | ||
119 | Q_EMIT connectionClosing(); | 118 | Q_EMIT connectionClosing(); | ||
120 | return; | 119 | return; | ||
121 | } | 120 | } | ||
122 | 121 | | |||
123 | Tracer::self()->endConnection(m_identifier, QString()); | 122 | Tracer::self()->endConnection(m_identifier, QString()); | ||
124 | collectionReferenceManager()->removeSession(m_sessionId); | | |||
125 | 123 | | |||
126 | delete m_socket; | 124 | delete m_socket; | ||
127 | m_socket = nullptr; | 125 | m_socket = nullptr; | ||
128 | 126 | | |||
129 | if (m_idleTimer) { | 127 | if (m_idleTimer) { | ||
130 | m_idleTimer->stop(); | 128 | m_idleTimer->stop(); | ||
131 | } | 129 | } | ||
132 | delete m_idleTimer; | 130 | delete m_idleTimer; | ||
Show All 16 Lines | |||||
149 | DataStore *Connection::storageBackend() | 147 | DataStore *Connection::storageBackend() | ||
150 | { | 148 | { | ||
151 | if (!m_backend) { | 149 | if (!m_backend) { | ||
152 | m_backend = DataStore::self(); | 150 | m_backend = DataStore::self(); | ||
153 | } | 151 | } | ||
154 | return m_backend; | 152 | return m_backend; | ||
155 | } | 153 | } | ||
156 | 154 | | |||
157 | CollectionReferenceManager *Connection::collectionReferenceManager() | | |||
158 | { | | |||
159 | return CollectionReferenceManager::instance(); | | |||
160 | } | | |||
161 | | ||||
162 | Connection::~Connection() | 155 | Connection::~Connection() | ||
163 | { | 156 | { | ||
164 | quitThread(); | 157 | quitThread(); | ||
165 | 158 | | |||
166 | if (m_reportTime) { | 159 | if (m_reportTime) { | ||
167 | reportTime(); | 160 | reportTime(); | ||
168 | } | 161 | } | ||
169 | } | 162 | } | ||
▲ Show 20 Lines • Show All 355 Lines • Show Last 20 Lines |