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
629ddf0b
Commit
629ddf0b
authored
Mar 24, 2014
by
Aaron Kunze
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolves bug #3450 (Improperly cleaning up resources in DllMain)
parent
5600bc54
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
ocl.cpp
modules/core/src/ocl.cpp
+1
-1
system.cpp
modules/core/src/system.cpp
+10
-4
No files found.
modules/core/src/ocl.cpp
View file @
629ddf0b
...
...
@@ -1581,7 +1581,7 @@ void finish()
#define IMPLEMENT_REFCOUNTABLE() \
void addref() { CV_XADD(&refcount, 1); } \
void release() { if( CV_XADD(&refcount, -1) == 1 ) delete this; } \
void release() { if( CV_XADD(&refcount, -1) == 1
&& !cv::__termination
) delete this; } \
int refcount
/////////////////////////////////////////// Platform /////////////////////////////////////////////
...
...
modules/core/src/system.cpp
View file @
629ddf0b
...
...
@@ -918,16 +918,22 @@ public:
#pragma warning(disable:4447) // Disable warning 'main' signature found without threading model
#endif
BOOL
WINAPI
DllMain
(
HINSTANCE
,
DWORD
fdwReason
,
LPVOID
);
extern
"C"
BOOL
WINAPI
DllMain
(
HINSTANCE
,
DWORD
fdwReason
,
LPVOID
lpReserved
)
{
if
(
fdwReason
==
DLL_THREAD_DETACH
||
fdwReason
==
DLL_PROCESS_DETACH
)
{
if
(
lpReserved
!=
NULL
)
// called after ExitProcess() call
{
cv
::
__termination
=
true
;
cv
::
deleteThreadAllocData
();
cv
::
deleteThreadData
();
}
else
{
// Not allowed to free resources if lpReserved is non-null
// http://msdn.microsoft.com/en-us/library/windows/desktop/ms682583.aspx
cv
::
deleteThreadAllocData
();
cv
::
deleteThreadData
();
}
}
return
TRUE
;
}
...
...
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