summaryrefslogtreecommitdiffhomepage
path: root/doc/mrbgems/README.md
diff options
context:
space:
mode:
authorYuichiro MASUI <[email protected]>2013-01-22 20:18:48 +0900
committerYuichiro MASUI <[email protected]>2013-01-22 20:18:48 +0900
commit310b0dce8fa1e3f98b2184c2b6c1a0f091c2d4eb (patch)
treedf4a8cc57c2d5b52fe20aa3fafbc6508799e3512 /doc/mrbgems/README.md
parentcc2e4e73deea917ffd0c9ce6ad2840455df7b60b (diff)
downloadmruby-310b0dce8fa1e3f98b2184c2b6c1a0f091c2d4eb.tar.gz
mruby-310b0dce8fa1e3f98b2184c2b6c1a0f091c2d4eb.zip
Added finalizer of mrbgems
Diffstat (limited to 'doc/mrbgems/README.md')
-rw-r--r--doc/mrbgems/README.md15
1 files changed, 15 insertions, 0 deletions
diff --git a/doc/mrbgems/README.md b/doc/mrbgems/README.md
index 9e930d8b2..fb27aa37b 100644
--- a/doc/mrbgems/README.md
+++ b/doc/mrbgems/README.md
@@ -106,6 +106,21 @@ mrb_c_extension_example_gem_init(mrb_state* mrb) {
}
```
+### Finalize
+
+mrbgems expects that you have implemented a C method called
+```mrb_YOURGEMNAME_gem_final(mrb_state)```. ```YOURGEMNAME``` will be replaced
+by the name of your GEM. If you call your GEM *c_extension_example*, your
+finalizer method could look like this:
+
+```
+void
+mrb_c_extension_example_gem_final(mrb_state* mrb) {
+ free(someone);
+}
+```
+
+
### Example
```