MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / shutdown_shadow

Function shutdown_shadow

src/jrd/sdw.cpp:879–918  ·  view source on GitHub ↗

It's never called directly, but through SDW_check().

Source from the content-addressed store, hash-verified

877
878// It's never called directly, but through SDW_check().
879static void shutdown_shadow(Shadow* shadow)
880{
881/**************************************
882 *
883 * s h u t d o w n _ s h a d o w
884 *
885 **************************************
886 *
887 * Functional description
888 * Stop shadowing to a given shadow number.
889 *
890 **************************************/
891 if (!shadow)
892 return;
893
894 Database* dbb = GET_DBB();
895
896 // find the shadow block and delete it from linked list
897
898 for (Shadow** ptr = &dbb->dbb_shadow; *ptr; ptr = &(*ptr)->sdw_next)
899 {
900 if (*ptr == shadow)
901 {
902 *ptr = shadow->sdw_next;
903 break;
904 }
905 }
906
907 // close the shadow files and free up the associated memory
908
909 PIO_close(shadow->sdw_file);
910 jrd_file* file;
911 jrd_file* free = shadow->sdw_file;
912
913 for (; (file = free->fil_next); free = file)
914 delete free;
915
916 delete free;
917 delete shadow;
918}
919
920
921void SDW_start(thread_db* tdbb, const TEXT* file_name,

Callers 1

SDW_checkFunction · 0.85

Calls 2

GET_DBBFunction · 0.85
PIO_closeFunction · 0.50

Tested by

no test coverage detected