go-spatial / go-mbgl

Go bindings for Mapbox GL Native
16 stars 1 forks source link

Map Snaphsotter calls Scheduler destructor #6

Open ear7h opened 6 years ago

ear7h commented 6 years ago

This means that a passed Scheduler to NewMapSnapshotter will be destroyed when the MapSanpshotter gets destroyed. The cause of this is that the c++ constructor takes in shared_ptr<Scheduler> (which is currently being generated in the C.mbgl_map_sna... call.

Neither C or Go has a concept of generics to emulate the shared_ptr<T> type, one way to mitigate this issue is to always make Scheduler (rather the child class ThreadPool) a shared_pointer.