Hello, I hope this is the right place for C++ bindings improvements.
The current C++ headers allow for a possible premature destruction of program objects before the kernels using them have been destroyed.
When a kernel is created from a program object, it does not increment the program objects ref counter. If the program object goes out of scope (let's say you had a single compilation function) before the kernel object this might cause trouble.
I haven't noticed this as an error in my programs on ATI/NVidia's platforms but Gremedy certainly reports it as an OpenCL error.