mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
vweb: free app object for each request
This commit is contained in:
9
.github/workflows/ci.yml
vendored
9
.github/workflows/ci.yml
vendored
@@ -326,6 +326,15 @@ jobs:
|
|||||||
../v -autofree .
|
../v -autofree .
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
|
# - name: Test c2v
|
||||||
|
# run: |
|
||||||
|
# git clone --depth 1 https://github.com/vlang/c2v
|
||||||
|
# cd c2v && ../v -o c2v .
|
||||||
|
# ../v .
|
||||||
|
# ../v run tests/run_tests.vsh
|
||||||
|
# ../v -experimental -w c2v_test.v
|
||||||
|
# cd ..
|
||||||
|
|
||||||
- name: Build V UI examples
|
- name: Build V UI examples
|
||||||
run: |
|
run: |
|
||||||
git clone --depth 1 https://github.com/vlang/ui
|
git clone --depth 1 https://github.com/vlang/ui
|
||||||
|
@@ -297,6 +297,7 @@ interface DbInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// run_app
|
// run_app
|
||||||
|
[manualfree]
|
||||||
pub fn run<T>(global_app &T, port int) {
|
pub fn run<T>(global_app &T, port int) {
|
||||||
// x := global_app.clone()
|
// x := global_app.clone()
|
||||||
// mut global_app := &T{}
|
// mut global_app := &T{}
|
||||||
@@ -348,6 +349,9 @@ fn handle_conn<T>(mut conn net.TcpConn, mut app T) {
|
|||||||
conn.set_write_timeout(30 * time.second)
|
conn.set_write_timeout(30 * time.second)
|
||||||
defer {
|
defer {
|
||||||
conn.close() or {}
|
conn.close() or {}
|
||||||
|
unsafe {
|
||||||
|
free(app)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
mut reader := io.new_buffered_reader(reader: conn)
|
mut reader := io.new_buffered_reader(reader: conn)
|
||||||
defer {
|
defer {
|
||||||
|
Reference in New Issue
Block a user