private static void checkNoLifecycleReferences(@Nullable final Object obj, @Nullable final LifecycleOwner allowedLifecycle) {
        if (obj == null) {
            return;
        }
        final Set<Class<? extends LifecycleOwner>> lifecycleClasses = CommonUtils.getReferencedClasses(obj, LifecycleOwner.class);
        if (lifecycleClasses.isEmpty()) {
            return;
        }
        if (lifecycleClasses.size() == 1 && allowedLifecycle != null && lifecycleClasses.contains(allowedLifecycle.getClass())) {
            return;
        }

        throw new IllegalStateException("Class '" + obj.getClass() + "' contains back-reference to LifecycleOwner(s) '" + lifecycleClasses + "'" +
            "This is not allowed because it would produce memory leaks!");
    }
Call this method to "finish" a task (means: when result is processed)
main/src/main/java/cgeo/geocaching/utils/workertask/WorkerTask.java