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
3f102e5d
Commit
3f102e5d
authored
Jul 25, 2017
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dnn: protobuf shutdown
parent
aad6d28e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
init.cpp
modules/dnn/src/init.cpp
+17
-0
No files found.
modules/dnn/src/init.cpp
View file @
3f102e5d
...
@@ -42,6 +42,8 @@
...
@@ -42,6 +42,8 @@
#include "precomp.hpp"
#include "precomp.hpp"
#include <opencv2/dnn/layer.details.hpp>
#include <opencv2/dnn/layer.details.hpp>
#include <google/protobuf/stubs/common.h>
namespace
cv
{
namespace
cv
{
namespace
dnn
{
namespace
dnn
{
CV__DNN_EXPERIMENTAL_NS_BEGIN
CV__DNN_EXPERIMENTAL_NS_BEGIN
...
@@ -56,11 +58,26 @@ Mutex& getInitializationMutex()
...
@@ -56,11 +58,26 @@ Mutex& getInitializationMutex()
// force initialization (single-threaded environment)
// force initialization (single-threaded environment)
Mutex
*
__initialization_mutex_initializer
=
&
getInitializationMutex
();
Mutex
*
__initialization_mutex_initializer
=
&
getInitializationMutex
();
namespace
{
using
namespace
google
::
protobuf
;
class
ProtobufShutdown
{
public
:
bool
initialized
;
ProtobufShutdown
()
:
initialized
(
true
)
{}
~
ProtobufShutdown
()
{
initialized
=
false
;
google
::
protobuf
::
ShutdownProtobufLibrary
();
}
};
}
// namespace
void
initializeLayerFactory
()
void
initializeLayerFactory
()
{
{
CV_TRACE_FUNCTION
();
CV_TRACE_FUNCTION
();
static
ProtobufShutdown
protobufShutdown
;
(
void
)
protobufShutdown
;
CV_DNN_REGISTER_LAYER_CLASS
(
Slice
,
SliceLayer
);
CV_DNN_REGISTER_LAYER_CLASS
(
Slice
,
SliceLayer
);
CV_DNN_REGISTER_LAYER_CLASS
(
Split
,
SplitLayer
);
CV_DNN_REGISTER_LAYER_CLASS
(
Split
,
SplitLayer
);
CV_DNN_REGISTER_LAYER_CLASS
(
Concat
,
ConcatLayer
);
CV_DNN_REGISTER_LAYER_CLASS
(
Concat
,
ConcatLayer
);
...
...
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