From 778ca33725a8bfac629b405f0bd26cfefaf47caf Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sun, 3 Jun 2007 17:42:54 +0000 Subject: Have ParticleEmitter load a possible particle image early on and don't cause a crash when the image can't be found. --- src/imageparticle.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/imageparticle.cpp') diff --git a/src/imageparticle.cpp b/src/imageparticle.cpp index 410782bd..35cc21ad 100644 --- a/src/imageparticle.cpp +++ b/src/imageparticle.cpp @@ -31,6 +31,12 @@ ImageParticle::ImageParticle(Map *map, Image *image): Particle(map), mImage(image) { + mImage->incRef(); +} + +ImageParticle::~ImageParticle() +{ + mImage->decRef(); } void ImageParticle::draw(Graphics *graphics, int offsetX, int offsetY) const -- cgit v1.2.3-70-g09d2