fixed exception

reset is called from MemoryDataSource.CreateFrom before the
cachedprimitive collection is created, resulting in the exception