Local stability for a general wetting functional