• Tom Stellard's avatar
    ocl: Change static variable order in cl_context.cpp to avoid crashes during destruction · 8f3b876e
    Tom Stellard authored
    ContextImpl::currentContext contains a reference to one of the
    DeviceInfoImpl objects from:
    
    static std::vector<DeviceInfoImpl> global_devices;
    
    ContextImpl::currentContext is destroyed in the destructor
    for the statically defined object __module, and relies on its
    DeviceInfoImpl reference to query some hardware features while
    being destroyed.
    
    This means that we need to ensure that the global_devices vector is
    destroyed affter __module, otherwise ContextImpl::currentContext's
    DeviceInfoImpl reference will no longer be valid when __module is
    destroyed.
    
    Since these variables are all confined to a single compilation unit,
    they will be destruct from bottom to top, so we need to make sure
    that __module is the bottom definition so it can be destroyed first.
    8f3b876e
Name
Last commit
Last update
..
androidcamera Loading commit data...
calib3d Loading commit data...
contrib Loading commit data...
core Loading commit data...
dynamicuda Loading commit data...
features2d Loading commit data...
flann Loading commit data...
gpu Loading commit data...
highgui Loading commit data...
imgproc Loading commit data...
java Loading commit data...
legacy Loading commit data...
ml Loading commit data...
nonfree Loading commit data...
objdetect Loading commit data...
ocl Loading commit data...
photo Loading commit data...
python Loading commit data...
stitching Loading commit data...
superres Loading commit data...
ts Loading commit data...
video Loading commit data...
videostab Loading commit data...
viz Loading commit data...
world Loading commit data...
CMakeLists.txt Loading commit data...
refman.rst.in Loading commit data...