| ︙ | | | ︙ | |
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include "tclInt.h"
/*
* The following structure describes a library that has been loaded either
* dynamically (with the "load" command) or statically (as indicated by a call
* to Tcl_StaticLibrary). All such libraries are linked together into a
* single list for the process.
*/
|
<
|
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include "tclInt.h"
/*
* The following structure describes a library that has been loaded either
* dynamically (with the "load" command) or statically (as indicated by a call
* to Tcl_StaticLibrary). All such libraries are linked together into a
* single list for the process.
*/
|
| ︙ | | | ︙ | |
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
|
code = TCL_ERROR;
goto done;
}
}
unloadProc = libraryPtr->unloadProc;
}
/*
* We are ready to unload the library. First, evaluate the unload
* function. If this fails, we cannot proceed with unload. Also, we must
* specify the proper flag to pass to the unload callback.
* TCL_UNLOAD_DETACH_FROM_INTERPRETER is defined when the callback should
* only remove itself from the interpreter; the library will be unloaded
* in a future call of unload. In case the library will be unloaded just
|
<
<
|
816
817
818
819
820
821
822
823
824
825
826
827
828
829
|
code = TCL_ERROR;
goto done;
}
}
unloadProc = libraryPtr->unloadProc;
}
/*
* We are ready to unload the library. First, evaluate the unload
* function. If this fails, we cannot proceed with unload. Also, we must
* specify the proper flag to pass to the unload callback.
* TCL_UNLOAD_DETACH_FROM_INTERPRETER is defined when the callback should
* only remove itself from the interpreter; the library will be unloaded
* in a future call of unload. In case the library will be unloaded just
|
| ︙ | | | ︙ | |
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
|
if (safeRefCount <= 0 && trustedRefCount <= 0) {
code = TCL_UNLOAD_DETACH_FROM_PROCESS;
}
}
code = unloadProc(target, code);
}
if (code != TCL_OK) {
Tcl_TransferResult(target, code, interp);
goto done;
}
/*
* Remove this library from the interpreter's library cache.
*/
ipFirstPtr = (InterpLibrary *)Tcl_GetAssocData(target, "tclLoad", NULL);
ipPtr = ipFirstPtr;
|
<
<
|
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
|
if (safeRefCount <= 0 && trustedRefCount <= 0) {
code = TCL_UNLOAD_DETACH_FROM_PROCESS;
}
}
code = unloadProc(target, code);
}
if (code != TCL_OK) {
Tcl_TransferResult(target, code, interp);
goto done;
}
/*
* Remove this library from the interpreter's library cache.
*/
ipFirstPtr = (InterpLibrary *)Tcl_GetAssocData(target, "tclLoad", NULL);
ipPtr = ipFirstPtr;
|
| ︙ | | | ︙ | |
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
|
ipPrevPtr->nextPtr = ipPtr->nextPtr;
break;
}
}
}
Tcl_Free(ipPtr);
Tcl_SetAssocData(target, "tclLoad", LoadCleanupProc, ipFirstPtr);
if (IsStatic(libraryPtr)) {
goto done;
}
/*
* The unload function was called succesfully.
|
<
|
875
876
877
878
879
880
881
882
883
884
885
886
887
888
|
ipPrevPtr->nextPtr = ipPtr->nextPtr;
break;
}
}
}
Tcl_Free(ipPtr);
Tcl_SetAssocData(target, "tclLoad", LoadCleanupProc, ipFirstPtr);
if (IsStatic(libraryPtr)) {
goto done;
}
/*
* The unload function was called succesfully.
|
| ︙ | | | ︙ | |