# cleanup_system.rs - source
Source of the Rust file `maplibre/src/render/systems/cleanup_system.rs`.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16

    use crate::{
        context::MapContext,
        render::render_phase::{LayerItem, RenderPhase, TileMaskItem},
    };

    pub fn cleanup_system(MapContext { world, .. }: &mut MapContext) {
        let Some((layer_item_phase, tile_mask_phase)) = world
            .resources
            .query_mut::<(&mut RenderPhase<LayerItem>, &mut RenderPhase<TileMaskItem>)>()
        else {
            return;
        };

        layer_item_phase.clear();
        tile_mask_phase.clear();
    }