ocl: Move static oclMat variables into FarnebackOpticalFlow class
authorTom Stellard <thomas.stellard@amd.com>
Thu, 13 Nov 2014 16:16:10 +0000 (11:16 -0500)
committerTom Stellard <thomas.stellard@amd.com>
Thu, 13 Nov 2014 16:16:10 +0000 (11:16 -0500)
commit42b1bd56cc0fbbfd0f2bd0957dd7e45dd57d3631
tree04b930d5a5d1c77bac31a6854b674f1f5ab886e6
parenteedde323ce289bdcb36030bac1651d8272415421
ocl: Move static oclMat variables into FarnebackOpticalFlow class

Move some static functions into the FarnebackOpticalFlow class as well,
so they can access these new class variables.

oclMat objects cannot be declared statically, because their destructor
depends on the statically defined __module variable from cl_context.cpp.
Since statically defined variables in separate compilation units have
an undefined destruction order there is always the possibility the
__module will be destructed before an oclMat object, which results
in a segfault.
modules/ocl/include/opencv2/ocl/ocl.hpp
modules/ocl/src/optical_flow_farneback.cpp