src/Map.cpp
void MapDeleteCB (XPLMMapLayerID       inLayer,
                  void *               ) // inRefcon
{
    // This is a plugin entry function, so we try to catch all exceptions
    try {
        // find the entry in the map and remove it
        mapMapLayerIDTy::iterator iter =
        std::find_if(glob.mapMapLayers.begin(), glob.mapMapLayers.end(),
                     [inLayer](const mapMapLayerIDTy::value_type& p)
                     {return p.second == inLayer;});
        if (iter != glob.mapMapLayers.end())
            glob.mapMapLayers.erase(iter);
    }
    catch (const std::exception& e) { LOG_MSG(logFATAL, ERR_EXCEPTION, e.what()); }
    catch (...) { LOG_MSG(logFATAL, ERR_EXCEPTION, "<unknown>"); }
}
/// Called when a map is about to be deleted
Called when a map is about to be deleted
Called when a map is about to be deleted
void MapDeleteCB (XPLMMapLayerID       inLayer,
                  void *               ) 
{
    try {
        mapMapLayerIDTy::iterator iter =
        std::find_if(glob.mapMapLayers.begin(), glob.mapMapLayers.end(),
                     [inLayer](const mapMapLayerIDTy::value_type& p)
                     {return p.second == inLayer;});
        if (iter != glob.mapMapLayers.end())
            glob.mapMapLayers.erase(iter);
    }
    catch (const std::exception& e) { LOG_MSG(logFATAL, ERR_EXCEPTION, e.what()); }
    catch (...) { LOG_MSG(logFATAL, ERR_EXCEPTION, "<unknown>"); }
}
void MapDeleteCB ( XPLMMapLayerID inLayer , void * ) { try { mapMapLayerIDTy :: iterator iter = std :: find_if ( glob . mapMapLayers . begin ( ) , glob . mapMapLayers . end ( ) , [ inLayer ] ( const mapMapLayerIDTy :: value_type & p ) { return p . second == inLayer ; } ) ; if ( iter != glob . mapMapLayers . end ( ) ) glob . mapMapLayers . erase ( iter ) ; } catch ( const std :: exception & e ) { LOG_MSG ( logFATAL , ERR_EXCEPTION , e . what ( ) ) ; } catch ( ... ) { LOG_MSG ( logFATAL , ERR_EXCEPTION , " " ) ; } }
Called when a map is about to be deleted
Called when a map is about to be deleted
// inRefcon // This is a plugin entry function, so we try to catch all exceptions // find the entry in the map and remove it