nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
47026cd
)
mongodb: avoid MongoCollection finalization by garbage collection
author
Alexandre Terrasa
<alexandre@moz-code.org>
Mon, 10 Aug 2015 22:29:18 +0000
(18:29 -0400)
committer
Alexandre Terrasa
<alexandre@moz-code.org>
Mon, 10 Aug 2015 22:31:54 +0000
(18:31 -0400)
Related to #1629
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
lib/mongodb/mongodb.nit
patch
|
blob
|
history
diff --git
a/lib/mongodb/mongodb.nit
b/lib/mongodb/mongodb.nit
index
2372179
..
1e9b9bd
100644
(file)
--- a/
lib/mongodb/mongodb.nit
+++ b/
lib/mongodb/mongodb.nit
@@
-601,6
+601,7
@@
class MongoCollection
fun find(query: JsonObject): nullable JsonObject do
assert is_alive
var c = native.find(query.to_bson.native)
+ assert is_alive # FIXME used to avoid segfault (so `self` isn't garbage collected to soon)
if c == null then return null
var cursor = new MongoCursor(c)
if cursor.is_ok then