summaryrefslogtreecommitdiffstats
path: root/src/util/statics.cpp
blob: 66add675e4433539fa81b2b782ea5d062bc670cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// SPDX-License-Identifier: GPL-2.0-or-later
#include "statics.h"

Inkscape::Util::StaticsBin &Inkscape::Util::StaticsBin::get()
{
    static StaticsBin instance;
    return instance;
}

void Inkscape::Util::StaticsBin::destroy()
{
    while (head) {
        head->destroy();
        head = head->next;
    }
}

Inkscape::Util::StaticsBin::~StaticsBin()
{
    // If this assertion triggers, then destroy() wasn't called close enough to the end of main().
    assert(!head && "StaticsBin::destroy() must be called before main() exit");
}