Skip to content

Commit

Permalink
[Fixes #1619] Clean up by reversing how we made the mess.
Browse files Browse the repository at this point in the history
  • Loading branch information
funkybob committed Sep 2, 2017
1 parent 5039a4b commit 0698548
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions plugins/python/python_plugin.c
Expand Up @@ -1091,9 +1091,10 @@ void *uwsgi_python_create_env_holy(struct wsgi_request *wsgi_req, struct uwsgi_a
}

void uwsgi_python_destroy_env_holy(struct wsgi_request *wsgi_req) {
// in non-multithread modes, we set uwsgi.env incrementing the refcount of the environ
if (uwsgi.threads < 2) {
Py_DECREF((PyObject *)wsgi_req->async_environ);
// in non-multithread modes, we set uwsgi.env, so let's remove it now
// to equalise the refcount of the environ
PyDict_DelItemString(up.embedded_dict, "env");
}
Py_DECREF((PyObject *) wsgi_req->async_args);
Py_DECREF((PyObject *)wsgi_req->async_environ);
Expand Down

0 comments on commit 0698548

Please sign in to comment.