Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-AMF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-AMF
Commits
3a67c067
Commit
3a67c067
authored
Sep 28, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update sighandler
parent
1b7d0e37
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
12 deletions
+18
-12
src/oai-amf/main.cpp
src/oai-amf/main.cpp
+18
-12
No files found.
src/oai-amf/main.cpp
View file @
3a67c067
...
...
@@ -57,13 +57,19 @@ AMFApiServer* amf_api_server_1 = nullptr;
amf_http2_server
*
amf_api_server_2
=
nullptr
;
//------------------------------------------------------------------------------
void
my_app
_signal_handler
(
int
s
)
{
void
amf
_signal_handler
(
int
s
)
{
std
::
cout
<<
"Caught signal "
<<
s
<<
std
::
endl
;
Logger
::
system
().
startup
(
"exiting"
);
itti_inst
->
send_terminate_msg
(
TASK_AMF_APP
);
itti_inst
->
wait_tasks_end
();
if
(
itti_inst
)
{
itti_inst
->
send_terminate_msg
(
TASK_AMF_APP
);
itti_inst
->
wait_tasks_end
();
}
std
::
cout
<<
"Freeing Allocated memory..."
<<
std
::
endl
;
if
(
amf_app_inst
)
{
delete
amf_app_inst
;
amf_app_inst
=
nullptr
;
std
::
cout
<<
"AMF APP memory done."
<<
std
::
endl
;
}
if
(
amf_api_server_1
)
{
amf_api_server_1
->
shutdown
();
delete
amf_api_server_1
;
...
...
@@ -75,14 +81,14 @@ void my_app_signal_handler(int s) {
amf_api_server_2
=
nullptr
;
}
std
::
cout
<<
"AMF API Server memory done."
<<
std
::
endl
;
if
(
itti_inst
)
delete
itti_inst
;
i
tti_inst
=
nullptr
;
std
::
cout
<<
"ITTI memory done."
<<
std
::
endl
;
if
(
amf_app_inst
)
delete
amf_app_inst
;
amf_app_inst
=
nullptr
;
std
::
cout
<<
"AMF APP memory done."
<<
std
::
endl
;
i
f
(
itti_inst
)
{
delete
itti_inst
;
itti_inst
=
nullptr
;
std
::
cout
<<
"ITTI memory done."
<<
std
::
endl
;
}
std
::
cout
<<
"Freeing Allocated memory done"
<<
std
::
endl
;
exit
(
0
);
exit
(
s
);
}
//------------------------------------------------------------------------------
...
...
@@ -98,7 +104,7 @@ int main(int argc, char** argv) {
Logger
::
amf_app
().
startup
(
"Options parsed!"
);
struct
sigaction
sigIntHandler
;
sigIntHandler
.
sa_handler
=
my_app
_signal_handler
;
sigIntHandler
.
sa_handler
=
amf
_signal_handler
;
sigemptyset
(
&
sigIntHandler
.
sa_mask
);
sigIntHandler
.
sa_flags
=
0
;
sigaction
(
SIGINT
,
&
sigIntHandler
,
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