Closed donpark closed 9 years ago
The bug here is the access exception/use-after-free, not the fact that it's stack allocated. Can you provide details (stack trace and how to reproduce)?
Exception happens when Map->start
is called so it should happen just by viewing a map.
Bad access exception is thrown in prepare
method called via start
-> run
.
If I allocate FileSource
in heap, exception is not thrown.
Oh I see, Map is not stack allocated here. I was assuming it was. You're totally right, everything needs to be heap allocated.
In
MGLMapView.m
, FileSource used to instantiatembgl::Map
is allocated on stack:This results in bad access exception later because by the time
fileSource
is used, it's no longer available.