cleanup: null checks.

This commit is contained in:
asofold 2016-12-19 07:42:50 +01:00
parent dcfdec79e2
commit 9d01191bcd

View File

@ -4047,10 +4047,15 @@ public class BlockProperties {
* Cleanup. Call init() to re-initialize.
*/
public static void cleanup() {
pLoc.cleanup();
pLoc = null;
wrapBlockCache.cleanup();
wrapBlockCache = null;
// (Null checks are error cases, to be intercepted elsewhere.)
if (pLoc != null) {
pLoc.cleanup();
pLoc = null;
}
if (wrapBlockCache != null) {
wrapBlockCache.cleanup();
wrapBlockCache = null;
}
// TODO: might empty mappings...
}