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.
This means that a passed
Scheduler
toNewMapSnapshotter
will be destroyed when theMapSanpshotter
gets destroyed. The cause of this is that thec++
constructor takes inshared_ptr<Scheduler>
(which is currently being generated in theC.mbgl_map_sna...
call.Neither
C
orGo
has a concept of generics to emulate theshared_ptr<T>
type, one way to mitigate this issue is to always makeScheduler
(rather the child classThreadPool
) ashared_pointer
.