code: int removeGeometry(int geometry) {
  		for (int path = getFirstPath(geometry); path != -1; path = removePath(path)) {
  			// removing paths in a loop
  		}
  
  		int prev = getPrevGeometry(geometry);
  		int next = getNextGeometry(geometry);
  		if (prev != -1)
  			setNextGeometry_(prev, next);
  		else {
  			m_first_geometry = next;
  		}
  		if (next != -1)
  			setPrevGeometry_(next, prev);
  		else {
  			m_last_geometry = prev;
  		}
  
  		freeGeometry_(geometry);
  		return next;
  	}
docs: Deletes existing geometry from the edit shape and returns the next one.