summaryrefslogtreecommitdiff
path: root/libs/pbd/pbd/destructible.h
blob: 7c5080633489dd7ce2050dc25d99d39aea2d4ea9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef __pbd_destructible_h__
#define __pbd_destructible_h__

#include <sigc++/signal.h>

namespace PBD {

/* be very very careful using this class. it does not inherit from sigc::trackable and thus
   should only be used in multiple-inheritance situations involving another type
   that does inherit from sigc::trackable (or sigc::trackable itself)
*/

class ThingWithGoingAway {
  public:
	virtual ~ThingWithGoingAway () {}
	sigc::signal<void> GoingAway;
};

class Destructible : public sigc::trackable, public ThingWithGoingAway {
  public:
	virtual ~Destructible () {}
	void drop_references () const { GoingAway(); }

};

}

#endif /* __pbd_destructible_h__ */