From 8906ff2e2755f6f8a2e52f5252afbcbea248c947 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Sun, 1 Jan 2017 12:03:58 +0100 Subject: instance_destroy that actually works; no more shared_ptr --- library.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'library.cpp') diff --git a/library.cpp b/library.cpp index 38bbf48..2386c0b 100644 --- a/library.cpp +++ b/library.cpp @@ -20,6 +20,14 @@ public: } } init_object; + +void instance_destroy(Object *obj){ + assert(global.objects.find(obj)!=global.objects.end()); + obj->destroy(); + global.objects_todelete.push_back(obj); +} + + static void draw_text(int x,int y,const char *s,size_t len){ if(currentFont!=nullptr){ sharedSfText.setFont(currentFont->sf_font); -- cgit v1.2.3-70-g09d2