Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
node-sqlite3
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
俞永鹏
node-sqlite3
Commits
75598851
Commit
75598851
authored
Mar 25, 2010
by
Orlando Vazquez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix crashes related to Dispose()'ing of functions we are currently in
parent
f04f70c6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
15 deletions
+13
-15
speedtest-low-parallel.js
speedtest-low-parallel.js
+1
-0
sqlite3_bindings.cc
sqlite3_bindings.cc
+7
-13
wscript
wscript
+5
-2
No files found.
speedtest-low-parallel.js
View file @
75598851
...
...
@@ -29,6 +29,7 @@ function getRows() {
db
.
prepare
(
"SELECT * FROM t1"
,
function
(
error
,
st
)
{
if
(
error
)
throw
error
;
rows
=
0
;
t0
=
new
Date
();
statement
=
st
;
statement
.
step
(
onStep
);
});
...
...
sqlite3_bindings.cc
View file @
75598851
...
...
@@ -258,7 +258,7 @@ protected:
static
int
EIO_Close
(
eio_req
*
req
)
{
struct
close_request
*
close_req
=
(
struct
close_request
*
)(
req
->
data
);
Sqlite3Db
*
dbo
=
close_req
->
dbo
;
int
rc
=
req
->
result
=
sqlite3_close
(
dbo
->
db_
);
req
->
result
=
sqlite3_close
(
dbo
->
db_
);
dbo
->
db_
=
NULL
;
return
0
;
}
...
...
@@ -465,7 +465,6 @@ protected:
static
Handle
<
Value
>
New
(
const
Arguments
&
args
)
{
HandleScope
scope
;
int
I
=
0
;
REQ_EXT_ARG
(
0
,
stmt
);
int
first_rc
=
args
[
1
]
->
IntegerValue
();
...
...
@@ -478,8 +477,7 @@ protected:
protected
:
Statement
(
sqlite3_stmt
*
stmt
,
int
first_rc
=
-
1
)
:
EventEmitter
(),
stmt_
(
stmt
),
step_req
(
NULL
)
{
first_rc_
=
first_rc
;
:
EventEmitter
(),
step_req
(
NULL
),
first_rc_
(
first_rc
),
stmt_
(
stmt
)
{
}
~
Statement
()
{
...
...
@@ -523,8 +521,6 @@ protected:
HandleScope
scope
;
struct
bind_request
*
bind_req
=
(
struct
bind_request
*
)(
req
->
data
);
Statement
*
sto
=
bind_req
->
sto
;
Local
<
Value
>
argv
[
1
];
bool
err
=
false
;
if
(
req
->
result
)
{
...
...
@@ -794,12 +790,11 @@ protected:
HandleScope
scope
;
struct
step_request
*
step_req
=
(
struct
step_request
*
)(
req
->
data
);
void
**
data
=
step_req
->
column_data
;
Local
<
Value
>
argv
[
2
];
if
(
step_req
->
error_msg
)
{
argv
[
0
]
=
Exception
::
Error
(
String
::
New
(
"
some error
"
));
argv
[
0
]
=
Exception
::
Error
(
String
::
New
(
"
Encountered an error while stepping through results
"
));
}
else
{
argv
[
0
]
=
Local
<
Value
>::
New
(
Undefined
());
...
...
@@ -852,11 +847,11 @@ protected:
FatalException
(
try_catch
);
}
step_req
->
cb
.
Dispose
();
// Disposing of the callback here causes v8 to freak out
// step_req->cb.Dispose();
if
(
req
->
result
==
SQLITE_DONE
&&
step_req
->
column_count
)
{
printf
(
"disposing of memory
\n
"
);
free
((
void
**
)
step_req
->
column_data
);
free
(
step_req
->
column_data
);
step_req
->
column_data
=
NULL
;
}
...
...
@@ -915,12 +910,11 @@ protected:
switch
(
type
)
{
case
SQLITE_INTEGER
:
{
// XXX reuse this space instead of allocating every time
step_req
->
column_data
[
i
]
=
(
int
*
)
malloc
(
sizeof
(
int
));
int
value
=
sqlite3_column_int
(
stmt
,
i
);
if
(
!
step_req
->
column_data
[
i
])
{
printf
(
"zomg
\n
"
);
}
*
(
int
*
)(
step_req
->
column_data
[
i
])
=
value
;
// printf("addr was %p\n", step_req->column_data[i]);
assert
(
step_req
->
column_data
[
i
]);
}
break
;
...
...
wscript
View file @
75598851
...
...
@@ -15,14 +15,17 @@ def configure(conf):
conf.check_tool("node_addon")
if not conf.check_cfg(package='sqlite3', args='--cflags --libs', uselib_store='SQLITE3'):
conf.fatal('Missing sqlite3');
# conf.check_cfg(package='profiler', args='--cflags --libs', uselib_store='SQLITE3')
# conf.env.append_value('LIBPATH_PROFILER', '/usr/local/lib')
# conf.env.append_value('LIB_PROFILER', 'profiler')
def build(bld):
obj = bld.new_task_gen("cxx", "shlib", "node_addon")
obj.cxxflags = ["-g", "-D_FILE_OFFSET_BITS=64", "-D_LARGEFILE_SOURCE"]
obj.cxxflags = ["-g", "-D_FILE_OFFSET_BITS=64", "-D_LARGEFILE_SOURCE"
, "-Wall"
]
obj.target = "sqlite3_bindings"
obj.source = "sqlite3_bindings.cc"
#obj.lib = "sqlite3"
obj.uselib =
"SQLITE3
"
obj.uselib =
"SQLITE3 PROFILER
"
t = 'sqlite3_bindings.node'
def shutdown():
...
...
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