std::shared_ptr<mir::EmergencyCleanup> mir::DefaultServerConfiguration::the_emergency_cleanup() { return emergency_cleanup( []() { return std::make_shared<DefaultEmergencyCleanup>(); }); }
/* Use this function instead of exit() in all g13 modules. */ void g13_exit (int rc) { gcry_control (GCRYCTL_UPDATE_RANDOM_SEED_FILE); if (opt.debug & DBG_MEMSTAT_VALUE) { gcry_control( GCRYCTL_DUMP_MEMORY_STATS ); gcry_control( GCRYCTL_DUMP_RANDOM_STATS ); } if (opt.debug) gcry_control (GCRYCTL_DUMP_SECMEM_STATS ); emergency_cleanup (); rc = rc? rc : log_get_errorcount(0)? 2 : g13_errors_seen? 1 : 0; exit (rc); }
rxvt_term::~rxvt_term () { termlist.erase (find (termlist.begin (), termlist.end(), this)); emergency_cleanup (); #if ENABLE_STYLES for (int i = RS_styleCount; --i; ) if (fontset[i] != fontset[0]) delete fontset[i]; #endif delete fontset[0]; #ifdef HAVE_BG_PIXMAP bgPixmap.destroy (); #endif #ifdef HAVE_AFTERIMAGE if (asv) destroy_asvisual (asv, 0); if (asimman) destroy_image_manager (asimman, 0); #endif if (display) { selection_clear (); #ifdef USE_XIM im_destroy (); #endif scrollBar.destroy (); if (gc) XFreeGC (dpy, gc); delete drawable; // destroy all windows if (parent[0]) XDestroyWindow (dpy, parent[0]); for (int i = 0; i < TOTAL_COLORS; i++) if (ISSET_PIXCOLOR (i)) { pix_colors_focused [i].free (this); #if OFF_FOCUS_FADING pix_colors_unfocused [i].free (this); #endif } clear (); display->flush (); /* ideally .put should do this */ displays.put (display); } scr_release (); /* clear all resources */ for (int i = 0; i < allocated.size (); i++) free (allocated [i]); free (selection.text); // TODO: manage env vars in child only(!) free (env_display); free (env_term); free (locale); free (v_buffer); free (incr_buf); delete envv; delete argv; #ifdef KEYSYM_RESOURCE delete keyboard; #endif #ifndef NO_RESOURCES XrmDestroyDatabase (option_db); #endif }