aboutsummaryrefslogtreecommitdiff
path: root/bindings/ruby/database.c
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@gmail.com>2021-05-17 14:39:14 -0500
committerDavid Bremner <david@tethera.net>2021-07-18 17:08:42 -0300
commit02b162116079a0b2e35823e5590a82056d22c8af (patch)
treedb730bca9f8619f356a028cdef059ef7783df814 /bindings/ruby/database.c
parent02cf4a50bb531aab7afdb1b48ecc656211b791e8 (diff)
ruby: create an actual wrapper struct
Currently Ruby data points directly to a notmuch object (e.g. notmuch_database_t), since we don't need any extra data that is fine. However, in the next commit we will need extra data, therefore we create a new struct notmuch_rb_object_t wrapper which contains nothing but a pointer to the current pointer (e.g. notmuch_database_t). This struct is tied to the Ruby object, and is freed when the Ruby object is freed by the garbage collector. We do nothing with this wrapper, so no functionality should be changed. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Diffstat (limited to 'bindings/ruby/database.c')
-rw-r--r--bindings/ruby/database.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bindings/ruby/database.c b/bindings/ruby/database.c
index d6c804ac..0159aaac 100644
--- a/bindings/ruby/database.c
+++ b/bindings/ruby/database.c
@@ -81,7 +81,7 @@ notmuch_rb_database_initialize (int argc, VALUE *argv, VALUE self)
ret = notmuch_database_open (path, mode, &database);
notmuch_rb_status_raise (ret);
- DATA_PTR (self) = database;
+ DATA_PTR (self) = notmuch_rb_object_create (database);
return self;
}