When using the same class that inherits from OclFilter with the same cl_program
on deletion of the first Filter the cl_program is freed. That case a segmentation fault upon deletion of the next Filter with the same program because the program is already deleted.
Proposal:
This can be prevented by extending the OclResourceServiceImpl with a reference counter for the cl_program. When the counter reaches 0 the cl_program can be deleted without any problem. Also the counter should be threadsafe to prevent race conditions when using OclFilters in different threads.