I am trying to understand how local contexts work and I have a problem about them. When I create a shape, I don't want any open local context thats why I close all contexts first using CloseAllContexts(). And for selection mode, I open a local context. This way worked fine until I try to create shapes using selected shapes i.e. when I create a shape using the shape from SelectedShape(), I close the context and I get segmentation fault for next MoreSelected() call. Any advice?