Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
64244e16
Commit
64244e16
authored
Jan 20, 2014
by
Roman Donchenko
Committed by
OpenCV Buildbot
Jan 20, 2014
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2171 from djetter99:fix_static_init_order
parents
088535fa
6bf599b1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
system.cpp
modules/core/src/system.cpp
+11
-4
No files found.
modules/core/src/system.cpp
View file @
64244e16
...
...
@@ -1131,17 +1131,24 @@ public:
}
}
};
static
TLSContainerStorage
tlsContainerStorage
;
// This is a wrapper function that will ensure 'tlsContainerStorage' is constructed on first use.
// For more information: http://www.parashift.com/c++-faq/static-init-order-on-first-use.html
static
TLSContainerStorage
&
getTLSContainerStorage
()
{
static
TLSContainerStorage
*
tlsContainerStorage
=
new
TLSContainerStorage
();
return
*
tlsContainerStorage
;
}
TLSDataContainer
::
TLSDataContainer
()
:
key_
(
-
1
)
{
key_
=
tlsContainerStorage
.
allocateKey
(
this
);
key_
=
getTLSContainerStorage
()
.
allocateKey
(
this
);
}
TLSDataContainer
::~
TLSDataContainer
()
{
tlsContainerStorage
.
releaseKey
(
key_
,
this
);
getTLSContainerStorage
()
.
releaseKey
(
key_
,
this
);
key_
=
-
1
;
}
...
...
@@ -1166,7 +1173,7 @@ TLSStorage::~TLSStorage()
void
*&
data
=
tlsData_
[
i
];
if
(
data
)
{
tlsContainerStorage
.
destroyData
(
i
,
data
);
getTLSContainerStorage
()
.
destroyData
(
i
,
data
);
data
=
NULL
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment