Don't leak the previous cache

Change-Id: I61cb1c608a7de8efc63533085e86c6c17c05f545
Reviewed-on: https://gerrit.libreoffice.org/10793
Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu>
Tested-by: Lionel Elie Mamane <lionel@mamane.lu>