|
@@ -22,6 +22,7 @@ If you have any questions, please contact us: 1585346868@qq.com Or visit our web
|
|
|
#include "module/http/request.h"
|
|
#include "module/http/request.h"
|
|
|
#include "module/http/response.h"
|
|
#include "module/http/response.h"
|
|
|
#include "net/http_subscribe.h"
|
|
#include "net/http_subscribe.h"
|
|
|
|
|
+#include "module/request_temp_ptr.h"
|
|
|
fastweb::subscribe_manager::subscribe_manager(fastweb::app* app) :Interface(app)
|
|
fastweb::subscribe_manager::subscribe_manager(fastweb::app* app) :Interface(app)
|
|
|
{
|
|
{
|
|
|
}
|
|
}
|
|
@@ -62,6 +63,9 @@ bool fastweb::subscribe_manager::callback(network::http::request* request, netwo
|
|
|
bool ok_continue = false;
|
|
bool ok_continue = false;
|
|
|
auto lua = app()->state->get();
|
|
auto lua = app()->state->get();
|
|
|
std::string exception_string;
|
|
std::string exception_string;
|
|
|
|
|
+
|
|
|
|
|
+ // 临时指针管理(待释放资源)
|
|
|
|
|
+ module::request_temp_ptr request_temp_ptr;
|
|
|
try
|
|
try
|
|
|
{
|
|
{
|
|
|
sol::load_result script = lua->state->load_file(app()->config->website.dir + filepath);
|
|
sol::load_result script = lua->state->load_file(app()->config->website.dir + filepath);
|
|
@@ -85,7 +89,10 @@ bool fastweb::subscribe_manager::callback(network::http::request* request, netwo
|
|
|
exception_string = e.what();
|
|
exception_string = e.what();
|
|
|
if (app()->config->website.debug)
|
|
if (app()->config->website.debug)
|
|
|
LOG_ERROR("[subscribe][" + request->filepath() + "]: " + e.what());
|
|
LOG_ERROR("[subscribe][" + request->filepath() + "]: " + e.what());
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ // 释放临时指针
|
|
|
|
|
+ request_temp_ptr.clear();
|
|
|
|
|
+ // 释放lua资源
|
|
|
lua->state->collect_garbage();
|
|
lua->state->collect_garbage();
|
|
|
app()->state->push(lua);
|
|
app()->state->push(lua);
|
|
|
|
|
|