Fix memory leak preventing users from being unloaded

This commit is contained in:
Luck 2016-10-25 18:44:11 +01:00
parent ee3db1e5c5
commit 46b122a167
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B

View File

@ -73,7 +73,7 @@ public abstract class AbstractManager<I, T extends Identifiable<I>> implements F
* @return a {@link T} object if the object is loaded, returns null if the object is not loaded * @return a {@link T} object if the object is loaded, returns null if the object is not loaded
*/ */
public final T get(I id) { public final T get(I id) {
return objects.asMap().get(id); return objects.getIfPresent(id);
} }
/** /**
@ -91,7 +91,7 @@ public abstract class AbstractManager<I, T extends Identifiable<I>> implements F
*/ */
public final void unload(T t) { public final void unload(T t) {
if (t != null) { if (t != null) {
objects.invalidate(t); objects.invalidate(t.getId());
} }
} }