Index: libcfa/src/Makefile.am
===================================================================
--- libcfa/src/Makefile.am	(revision 3830c84601a67ed9f3f3ed3c53cdc89c7cbd925c)
+++ libcfa/src/Makefile.am	(revision 8512a2fd42c2d4fc810ffdfdcf6fa95b12afe3f1)
@@ -48,4 +48,5 @@
 	math.hfa \
 	time_t.hfa \
+    virtual_dtor.hfa \
 	bits/algorithm.hfa \
 	bits/align.hfa \
@@ -68,5 +69,5 @@
 	vec/vec2.hfa \
 	vec/vec3.hfa \
-	vec/vec4.hfa
+	vec/vec4.hfa 
 
 inst_headers_src = \
Index: libcfa/src/concurrency/actor.hfa
===================================================================
--- libcfa/src/concurrency/actor.hfa	(revision 3830c84601a67ed9f3f3ed3c53cdc89c7cbd925c)
+++ libcfa/src/concurrency/actor.hfa	(revision 8512a2fd42c2d4fc810ffdfdcf6fa95b12afe3f1)
@@ -5,4 +5,5 @@
 #include <kernel.hfa>
 #include <iofwd.hfa>
+#include <virtual_dtor.hfa>
 
 #ifdef __CFA_DEBUG__
@@ -357,5 +358,5 @@
     if ( seperate_clus ) delete( cluster );
 
-    #ifdef STATS
+    #ifdef STATS // print formatted stats
     printf("    Actor System Stats:\n");
     printf("\tActors Created:\t\t\t\t%lu\n\tMessages Sent:\t\t\t\t%lu\n", __num_actors_stats, __all_processed);
@@ -388,9 +389,10 @@
 static executor * __actor_executor_ = 0p;
 static bool __actor_executor_passed = false;            // was an executor passed to start_actor_system
-static size_t __num_actors_ = 0;				// number of actor objects in system
+static size_t __num_actors_ = 0;				        // number of actor objects in system
 static struct thread$ * __actor_executor_thd = 0p;		// used to wake executor after actors finish
 struct actor {
-    size_t ticket;	                        // executor-queue handle
+    size_t ticket;	                                    // executor-queue handle
     Allocation allocation_;			                    // allocation action
+    inline virtual_dtor;
 };
 
@@ -406,5 +408,4 @@
     #endif
 }
-static inline void ^?{}( actor & this ) {}
 
 static inline void check_actor( actor & this ) {
@@ -430,25 +431,21 @@
 struct message {
     Allocation allocation_;			// allocation action
+    inline virtual_dtor;
 };
 
-static inline void ?{}( message & this ) { this.allocation_ = Nodelete; }
+static inline void ?{}( message & this ) {
+    this.allocation_ = Nodelete;
+}
 static inline void ?{}( message & this, Allocation allocation ) {
     memcpy( &this.allocation_, &allocation, sizeof(allocation) ); // optimization to elide ctor
     verifyf( this.allocation_ != Finished, "The Finished Allocation status is not supported for message types.\n");
 }
-static inline void ^?{}( message & this ) {
-    CFA_DEBUG( if ( this.allocation_ == Nodelete ) printf("A message at location %p was allocated but never sent.\n", &this); )
+static inline void ^?{}( message & this ) with(this) {
+    CFA_DEBUG( if ( allocation_ == Nodelete ) printf("A message at location %p was allocated but never sent.\n", &this); )
 }
 
 static inline void check_message( message & this ) {
-    #ifdef __CFA_DEBUG__
-    Allocation temp = this.allocation_;
-    this.allocation_ = Finished;
-    switch ( temp )
-    #else
-    switch ( this.allocation_ )
-    #endif
-    {						// analyze message status
-        case Nodelete: break;
+    switch ( this.allocation_ ) {						// analyze message status
+        case Nodelete: CFA_DEBUG(this.allocation_ = Finished); break;
         case Delete: delete( &this ); break;
         case Destroy: ^?{}(this); break;
@@ -456,5 +453,7 @@
     } // switch
 }
-static inline void set_allocation( message & this, Allocation state ) { this.allocation_ = state; }
+static inline void set_allocation( message & this, Allocation state ) {
+    this.allocation_ = state;
+}
 
 static inline void deliver_request( request & this ) {
@@ -688,2 +687,3 @@
 Allocation receive( actor & this, __DestroyMsg & msg ) { return Destroy; }
 Allocation receive( actor & this, __FinishedMsg & msg ) { return Finished; }
+
Index: libcfa/src/virtual_dtor.hfa
===================================================================
--- libcfa/src/virtual_dtor.hfa	(revision 8512a2fd42c2d4fc810ffdfdcf6fa95b12afe3f1)
+++ libcfa/src/virtual_dtor.hfa	(revision 8512a2fd42c2d4fc810ffdfdcf6fa95b12afe3f1)
@@ -0,0 +1,38 @@
+// inline this structure to have a virtual dtor.
+// when using this, delete() is also virtual and will be called on the right address
+// using free() directly on polymorphic types may result in unaligned memory deallocation
+//     in multi-inheritance or in single inheritance if the inline isn't the first field
+
+// This supports virtual dtors for both single and multiple inheritance,
+// however it does not support multiple inheritance of the virtual_dtor. e.g.:
+//     given struct A { inline virtual_dtor; } and struct B { inline virtual_dtor; }
+//     struct C { inline A; inline B; } will result in undefined behaviour
+
+struct virtual_dtor {
+    void (*__virtual_dtor_ptr)(virtual_dtor &);
+    void * __virtual_obj_start;
+};
+
+// the following routines are used by the compiler and should not be called directly
+static inline void __CFA_set_virt_dtor( virtual_dtor & this, void (*v_dtor)(virtual_dtor &)) {
+    this.__virtual_dtor_ptr = v_dtor;
+}
+static inline void __CFA_set_virt_start( virtual_dtor & this, void * start) {
+    this.__virtual_obj_start = start;
+}
+static inline void __CFA_setup_dtor( virtual_dtor & this ) with(this) {
+    __virtual_dtor_ptr = 0p;
+    __virtual_obj_start = &this;
+}
+static inline void __CFA_dtor_shutdown( virtual_dtor & this ) with(this) {
+    if ( __virtual_dtor_ptr ) {
+        void (*dtor_ptr)(virtual_dtor &) = __virtual_dtor_ptr;
+        __virtual_dtor_ptr = 0p;
+        dtor_ptr(*((virtual_dtor *)__virtual_obj_start)); // replace actor with base type
+        return;
+    }
+}
+static inline void __CFA_virt_free( virtual_dtor & this ) { free( this.__virtual_obj_start ); }
+static inline void * __CFA_get_virt_start( virtual_dtor & this ) { return this.__virtual_obj_start; }
+static inline void ?{}( virtual_dtor & this ) {}
+static inline void ^?{}( virtual_dtor & this ) {}
