diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2009-03-26 21:13:34 -0400 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2009-03-26 21:13:34 -0400 |
| commit | ec21e4826720c3240a7c6400e90da08e24e601f8 (patch) | |
| tree | 8f6ea1b5a20f5546df4412ce5c0f316e94db66e7 /sigencore/plugins/CanvasPlugin.cpp | |
| parent | 6883378f184f040f39f8138490899e7cb33643b9 (diff) | |
| download | sigen-ec21e4826720c3240a7c6400e90da08e24e601f8.tar.gz sigen-ec21e4826720c3240a7c6400e90da08e24e601f8.tar.xz sigen-ec21e4826720c3240a7c6400e90da08e24e601f8.zip | |
Add a count method to the plugins for counting objects that are being used
Diffstat (limited to 'sigencore/plugins/CanvasPlugin.cpp')
| -rw-r--r-- | sigencore/plugins/CanvasPlugin.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sigencore/plugins/CanvasPlugin.cpp b/sigencore/plugins/CanvasPlugin.cpp index 3671151c..79682d97 100644 --- a/sigencore/plugins/CanvasPlugin.cpp +++ b/sigencore/plugins/CanvasPlugin.cpp @@ -43,7 +43,11 @@ CanvasPlugin::~CanvasPlugin() Canvas* CanvasPlugin::getCanvas(const QString& name, GameWrapper* game, Config* parent) { Canvas* arena = createCanvas(name, game, parent); - d->addCanvas(arena); + if (arena) + { + ++m_count; + d->addCanvas(arena); + } return arena; } @@ -69,5 +73,8 @@ void CanvasPlugin::Private::cleanupCanvas(QObject* object) { Canvas* arena = qobject_cast<Canvas*>(object); if (arena) + { q->cleanupCanvas(arena); + --q->m_count; + } } |
