private void clearResource(Hashtable resource){
        if (resource != null){
            Set keys = resource.keySet();
            Object value;
            for (Object key : keys){
                value = resource.get(key);
                if (value instanceof Reference){
                    library.removeObject((Reference)value);
                }
            }
        }
    }