Netcentric / vault-upgrade-hook

Jackrabbit FileVault Install Hook to perform additional actions during package installation
Eclipse Public License 1.0
19 stars 13 forks source link

Service references are never released #17

Closed kwin closed 5 years ago

kwin commented 7 years ago

All services being retrieved through https://github.com/Netcentric/vault-upgrade-hook/blob/master/vault-upgrade-hook/src/main/java/biz/netcentric/vlt/upgrade/util/Util.java#L34 are never properly released. Not using BundleContext.ungetService(ServiceReference) leads to classloader leaks.

nc-andreashaller commented 7 years ago

True, fixed it with https://github.com/Netcentric/vault-upgrade-hook/pull/8/commits/7021314f65bc6993647ecf572da70bcaa4b462af

kwin commented 7 years ago

Thanks, but I would suggest using try with resources and remove the close method on the OSGiUtil.

nc-andreashaller commented 7 years ago

This would mean to upgrade to Java8, I'd like to keep Java7 compatibility for now.

kwin commented 7 years ago

try-with-resources has been introduced with Java7.

nc-andreashaller commented 7 years ago

Oh, true. Changed it.

nc-andreashaller commented 5 years ago

Fixed in 1.0.0