mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-09-05 21:21:53 +00:00
bumped to 1.1 and added uwsgi.atexit
This commit is contained in:
@@ -195,6 +195,18 @@ void uwsgi_python_reset_random_seed() {
|
||||
#endif
|
||||
}
|
||||
|
||||
void uwsgi_python_atexit() {
|
||||
|
||||
// no need to worry about freeing memory
|
||||
PyObject *uwsgi_dict = get_uwsgi_pydict("uwsgi");
|
||||
if (uwsgi_dict) {
|
||||
PyObject *ae = PyDict_GetItemString(uwsgi_dict, "atexit");
|
||||
if (ae) {
|
||||
python_call(ae, PyTuple_New(0), 0, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void uwsgi_python_post_fork() {
|
||||
|
||||
#ifdef UWSGI_SPOOLER
|
||||
@@ -1441,6 +1453,7 @@ void uwsgi_python_fixup() {
|
||||
uwsgi.p[30] = uwsgi_malloc( sizeof(struct uwsgi_plugin) );
|
||||
memcpy(uwsgi.p[30], uwsgi.p[0], sizeof(struct uwsgi_plugin) );
|
||||
uwsgi.p[30]->init_thread = NULL;
|
||||
uwsgi.p[30]->atexit = NULL;
|
||||
}
|
||||
|
||||
void uwsgi_python_hijack(void) {
|
||||
@@ -1550,6 +1563,8 @@ struct uwsgi_plugin python_plugin = {
|
||||
|
||||
.spooler = uwsgi_python_spooler,
|
||||
|
||||
.atexit = uwsgi_python_atexit,
|
||||
|
||||
.code_string = uwsgi_python_code_string,
|
||||
|
||||
.help = uwsgi_python_help,
|
||||
|
||||
Reference in New Issue
Block a user