Make app QObject parent of StreamTiming singleton
This commit is contained in:
parent
b9345463c4
commit
e761bfa5c4
@ -23,8 +23,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
StreamTiming::StreamTiming()
|
||||
: QObject(nullptr) // FIXME: parent
|
||||
StreamTiming::StreamTiming(QObject *parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
// This class must be part of the main thread so that timers can work
|
||||
Q_ASSERT(this->thread() == QCoreApplication::instance()->thread());
|
||||
@ -219,7 +219,7 @@ StreamTiming* StreamTiming::instance()
|
||||
static StreamTiming *instance{nullptr};
|
||||
|
||||
if (!instance)
|
||||
instance = new StreamTiming();
|
||||
instance = new StreamTiming(QCoreApplication::instance());
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
@ -32,7 +32,6 @@ class StreamTiming : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
StreamTiming();
|
||||
|
||||
bool recordTxTime(uint portId, uint guid, uint ttagId,
|
||||
const struct timespec ×tamp);
|
||||
@ -50,6 +49,8 @@ public:
|
||||
static StreamTiming* instance();
|
||||
|
||||
private:
|
||||
StreamTiming(QObject *parent=nullptr);
|
||||
|
||||
int processRecords();
|
||||
int deleteStaleRecords();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user