rbplusplus 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3fb201af4add5d3b4df2114448e7649718e05611
4
- data.tar.gz: d33460614a7ad882559a67f837650313bec13732
3
+ metadata.gz: 2b46d18b052b660d61d767119e5361612cfa27b7
4
+ data.tar.gz: fa5a71e072d45f5b95ab8e148c592f2df321346a
5
5
  SHA512:
6
- metadata.gz: 150f0c8cda94227750e603d503b5893055b80a7ac792c7c7627c32bd3b7ba7d8e132cfd373c6e227713e311acddeba252ee277cf6148b7b08aa04a021c738448
7
- data.tar.gz: af6a24fda140fedcb82ec204c5a8d57a06ad024b22cde324023ddd1fdbcde3c45ffc8be3eaba862ec8a91eb49c71300a8a2c00cf5a3f983333e4d5a4f8314ba2
6
+ metadata.gz: 7e6eea6408d6f603d69217d5fb6cebee67eabc66183b63531f56d9cdff20b6e701fb8a0b16c627d4b2b75f65db732009d830a7fdfdb7926639a9642dc1269431
7
+ data.tar.gz: b6ef36296123e5cd86ec07341d9964adfc3679777b1822963e40043ed43c17014b377410212a57645479a0f644cd4662c3667254de555ff708014a61bfb6fa90
@@ -92,6 +92,7 @@ module RbPlusPlus
92
92
  # Build the wrapper method that gets exposed to Ruby
93
93
  declarations << "VALUE #{wrapper_func}(#{arg}) {"
94
94
  declarations << "\t#{block_var_name} = rb_block_proc();"
95
+ declarations << "\trb_gc_register_address(&#{block_var_name});"
95
96
  declarations << "\t#{callee}(&#{proxy_method_name});"
96
97
  declarations << "\treturn Qnil;"
97
98
  declarations << "}"
@@ -20,4 +20,17 @@ describe "Function pointers into class methods" do
20
20
 
21
21
  t.call_callback(12).should == 42
22
22
  end
23
+
24
+ specify "keeps the block marked in the GC" do
25
+ t = PointerTest.new
26
+ t.set_callback do |i|
27
+ 14
28
+ end
29
+
30
+ t.call_callback(12)
31
+
32
+ GC.start
33
+
34
+ t.call_callback(12).should == 14
35
+ end
23
36
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbplusplus
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Roelofs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-26 00:00:00.000000000 Z
11
+ date: 2014-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rbgccxml