fxruby 1.6.31-x86-mingw32 → 1.6.32.pre1-x86-mingw32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c0d4f6148a6a5eadb994a5a697f8ae6b36f48e1c
4
- data.tar.gz: 5b0901247dd69afa8c1ad1e220f31e92f0c7f1e7
3
+ metadata.gz: 2e5e7cd46f52afe225d1e85ad3decbef00cb7dbd
4
+ data.tar.gz: 941c719f951e7f0c93ccb3e1c58eb45bbbd6c689
5
5
  SHA512:
6
- metadata.gz: e5d4e858deb6be37e8ce5d57daf49d966b8928d8fc6c1ac088f9693f9384e0427a08c1f128bca8ac60d7cb42735d2866bae2b76e87478c242433f962170e0dab
7
- data.tar.gz: b6c4f7cbf870a538dd62c8e019964d1ec84e6a8897ca2348ebba2268919fbf9ec171d1798a4307685241044654286cf29d610dae133b14b16c1576ca1d81b580
6
+ metadata.gz: eab80d0e82739585e6c944a039e2521054a9d0e2eed04f3951fabb8ba74182f5e6e738554b33073c876901f80b8c3119b83c0d183cbd43e60eeb169d0ab30ffb
7
+ data.tar.gz: 450524756d456a2e1864522c68f78cf76495dc63d8c6056f924e863bf1b3e95025e2b3dcc5c976770807126aebf12f9db6602fa38de317565702a058caf05df3
data/History.txt CHANGED
@@ -1,3 +1,9 @@
1
+ === 1.6.32 / unreleased
2
+
3
+ * Avoid call to rb_class2name() during GC. Fixes #21
4
+ * Use release mode, unless extconf.rb is called with --enable-debug,
5
+ so that all FXTRACE() and FXASSERT() calls are skiped, per default.
6
+
1
7
  === 1.6.31 / 2015-07-21
2
8
 
3
9
  * Replace pipe2() by pipe() and fcntl(), because pipe2() is not as portable.
@@ -83,6 +83,17 @@ swig_type_info *FXRbTypeQuery(const char *desc){
83
83
 
84
84
  static st_table * FXRuby_Objects;
85
85
 
86
+ static const char * const safe_rb_obj_classname(VALUE obj)
87
+ {
88
+ if( rb_during_gc() ){
89
+ /* It's not safe to call rb_obj_classname() during GC.
90
+ * Return dummy value in this case. */
91
+ return "during GC";
92
+ } else {
93
+ return rb_obj_classname(obj);
94
+ }
95
+ }
96
+
86
97
  /**
87
98
  * Each value in the FXRuby_Objects hash table is an instance of this
88
99
  * struct. It identifies the Ruby instance associated with a C++ object.
@@ -115,7 +126,7 @@ VALUE FXRbNewPointerObj(void *ptr,swig_type_info* ty){
115
126
  FXRubyObjDesc *desc;
116
127
  if(FXMALLOC(&desc,FXRubyObjDesc,1)){
117
128
  obj=SWIG_Ruby_NewPointerObj(ptr,ty,1);
118
- FXTRACE((1,"FXRbNewPointerObj(foxObj=%p) => rubyObj=%p (%s)\n",ptr,(void *)obj,rb_obj_classname(obj)));
129
+ FXTRACE((1,"FXRbNewPointerObj(foxObj=%p) => rubyObj=%p (%s)\n",ptr,(void *)obj,safe_rb_obj_classname(obj)));
119
130
  desc->obj=obj;
120
131
  desc->borrowed=true;
121
132
  desc->in_gc=false;
@@ -150,25 +161,6 @@ bool FXRbIsBorrowed(void* ptr){
150
161
  }
151
162
  }
152
163
 
153
- bool FXRbSetInGC(const void* ptr, bool enabled){
154
- FXASSERT(ptr!=0);
155
- FXRubyObjDesc *desc;
156
- if(st_lookup(FXRuby_Objects,reinterpret_cast<st_data_t>(ptr),reinterpret_cast<st_data_t *>(&desc))!=0){
157
- desc->in_gc=enabled;
158
- return enabled;
159
- }
160
- return false;
161
- }
162
-
163
- bool FXRbIsInGC(const void* ptr){
164
- FXASSERT(ptr!=0);
165
- FXRubyObjDesc *desc;
166
- if(st_lookup(FXRuby_Objects,reinterpret_cast<st_data_t>(ptr),reinterpret_cast<st_data_t *>(&desc))!=0){
167
- return desc->in_gc;
168
- }
169
- return false;
170
- }
171
-
172
164
 
173
165
  /**
174
166
  * FXRbConvertPtr() is just a wrapper around SWIG_ConvertPtr().
@@ -267,7 +259,7 @@ void FXRbRegisterRubyObj(VALUE rubyObj,const void* foxObj) {
267
259
  FXASSERT(!NIL_P(rubyObj));
268
260
  FXASSERT(foxObj!=0);
269
261
  FXRubyObjDesc* desc;
270
- FXTRACE((1,"FXRbRegisterRubyObj(rubyObj=%p (%s),foxObj=%p)\n",(void *)rubyObj,rb_obj_classname(rubyObj),foxObj));
262
+ FXTRACE((1,"FXRbRegisterRubyObj(rubyObj=%p (%s),foxObj=%p)\n",(void *)rubyObj,safe_rb_obj_classname(rubyObj),foxObj));
271
263
  if(st_lookup(FXRuby_Objects,reinterpret_cast<st_data_t>(const_cast<void*>(foxObj)),reinterpret_cast<st_data_t *>(&desc))!=0){
272
264
  FXASSERT(desc->borrowed);
273
265
  /* There is already a Ruby object registered for this foxObj.
@@ -308,7 +300,7 @@ void FXRbUnregisterRubyObj2(const void* foxObj, bool alsoOwned){
308
300
  FXRubyObjDesc* desc;
309
301
  if(st_lookup(FXRuby_Objects,reinterpret_cast<st_data_t>(const_cast<void*>(foxObj)),reinterpret_cast<st_data_t *>(&desc))!=0){
310
302
  if( !alsoOwned && !desc->borrowed ) return;
311
- FXTRACE((1,"FXRbUnregisterRubyObj(rubyObj=%p (%s),foxObj=%p)\n",(void *)desc->obj,rb_obj_classname(desc->obj),foxObj));
303
+ FXTRACE((1,"FXRbUnregisterRubyObj(rubyObj=%p (%s),foxObj=%p)\n",(void *)desc->obj,safe_rb_obj_classname(desc->obj),foxObj));
312
304
  DATA_PTR(desc->obj)=0;
313
305
  FXFREE(&desc);
314
306
  st_delete(FXRuby_Objects,reinterpret_cast<st_data_t *>(const_cast<void**>(&foxObj)),reinterpret_cast<st_data_t *>(0));
@@ -356,7 +348,7 @@ VALUE FXRbGetRubyObj(const void *foxObj,bool alsoBorrowed){
356
348
  if(foxObj!=0 && st_lookup(FXRuby_Objects,reinterpret_cast<st_data_t>(const_cast<void*>(foxObj)),reinterpret_cast<st_data_t *>(&desc))!=0){
357
349
  FXASSERT(desc!=0);
358
350
  if(alsoBorrowed || !desc->borrowed){
359
- FXTRACE((2,"FXRbGetRubyObj(foxObj=%p) => rubyObj=%p (%s)\n",foxObj,(void *)desc->obj,rb_obj_classname(desc->obj)));
351
+ FXTRACE((2,"FXRbGetRubyObj(foxObj=%p) => rubyObj=%p (%s)\n",foxObj,(void *)desc->obj,safe_rb_obj_classname(desc->obj)));
360
352
  return desc->obj;
361
353
  }
362
354
  }
@@ -1435,7 +1427,6 @@ void FXRbRange2LoHi(VALUE range,FXdouble& lo,FXdouble& hi){
1435
1427
  void FXRbCallVoidMethod_gvlcb(FXObject* recv, const char *func) {
1436
1428
  VALUE obj=FXRbGetRubyObj(recv,false);
1437
1429
  FXASSERT(!NIL_P(obj));
1438
- FXASSERT(!FXRbIsInGC(recv));
1439
1430
  rb_funcall(obj,rb_intern(func),0,NULL);
1440
1431
  }
1441
1432
 
@@ -1642,7 +1633,7 @@ void FXRbCallDCDrawMethod_gvlcb(FXDC* recv, const char * func, FXint x,FXint y,c
1642
1633
  FXRbMenuCommand::~FXRbMenuCommand(){
1643
1634
  FXAccelTable *table;
1644
1635
  FXWindow *owner;
1645
- if(acckey && !FXRbIsInGC(this)){
1636
+ if(acckey && !rb_during_gc()){
1646
1637
  owner=getShell()->getOwner();
1647
1638
  if(owner){
1648
1639
  table=owner->getAccelTable();
@@ -1658,7 +1649,7 @@ FXRbMenuCommand::~FXRbMenuCommand(){
1658
1649
  FXRbMenuCheck::~FXRbMenuCheck(){
1659
1650
  FXAccelTable *table;
1660
1651
  FXWindow *owner;
1661
- if(acckey && !FXRbIsInGC(this)){
1652
+ if(acckey && !rb_during_gc()){
1662
1653
  owner=getShell()->getOwner();
1663
1654
  if(owner){
1664
1655
  table=owner->getAccelTable();
@@ -1674,7 +1665,7 @@ FXRbMenuCheck::~FXRbMenuCheck(){
1674
1665
  FXRbMenuRadio::~FXRbMenuRadio(){
1675
1666
  FXAccelTable *table;
1676
1667
  FXWindow *owner;
1677
- if(acckey && !FXRbIsInGC(this)){
1668
+ if(acckey && !rb_during_gc()){
1678
1669
  owner=getShell()->getOwner();
1679
1670
  if(owner){
1680
1671
  table=owner->getAccelTable();
@@ -230,6 +230,7 @@ def do_rake_compiler_setup
230
230
  "--without-x",
231
231
  "--enable-shared",
232
232
  "--disable-static",
233
+ enable_config("debug") ? "--enable-debug" : "--enable-release",
233
234
  ]
234
235
  class << recipe
235
236
  def compile
@@ -390,6 +391,10 @@ unless enable_config("win32-cross")
390
391
  end
391
392
  end
392
393
 
394
+ unless enable_config("debug")
395
+ $CPPFLAGS += " -DNDEBUG"
396
+ end
397
+
393
398
  # Platform-specific modifications
394
399
  do_rake_compiler_setup
395
400
 
@@ -149,7 +149,7 @@ inline void klass ## _dropDisable(klass* self){ \
149
149
  FXRbCallVoidMethod(this,"killFocus"); \
150
150
  } \
151
151
  void cls::changeFocus(FXWindow* child){ \
152
- if(!FXRbIsInGC(this)) FXRbCallVoidMethod(this,"changeFocus",child); \
152
+ if(!rb_during_gc()) FXRbCallVoidMethod(this,"changeFocus",child); \
153
153
  } \
154
154
  void cls::setDefault(FXbool enable){ \
155
155
  FXRbCallVoidMethod(this,"setDefault",enable); \
@@ -173,7 +173,7 @@ inline void klass ## _dropDisable(klass* self){ \
173
173
  FXRbCallVoidMethod(this,"position",x,y,w,h); \
174
174
  } \
175
175
  void cls::recalc(){ \
176
- if(!FXRbIsInGC(this)) FXRbCallVoidMethod(this,"recalc"); \
176
+ if(!rb_during_gc()) FXRbCallVoidMethod(this,"recalc"); \
177
177
  } \
178
178
  void cls::reparent(FXWindow* father,FXWindow* other){ \
179
179
  FXRbCallVoidMethod(this,"reparent",father,other); \
@@ -81,8 +81,6 @@ VALUE showHelper(VALUE self, int argc, VALUE *argv, TYPE *p, swig_type_info *typ
81
81
  // Wrapper around SWIG_Ruby_NewPointerObj()
82
82
  VALUE FXRbNewPointerObj(void *ptr, swig_type_info *typeinfo);
83
83
  bool FXRbIsBorrowed(void* ptr);
84
- bool FXRbSetInGC(const void* ptr, bool enabled);
85
- bool FXRbIsInGC(const void* ptr);
86
84
 
87
85
  // Wrapper around SWIG_TypeQuery()
88
86
  swig_type_info *FXRbTypeQuery(const char *name);
@@ -369,7 +367,6 @@ template<class TYPE>
369
367
  void FXRbCallVoidMethod_gvlcb(FXObject* recv,const char *func, TYPE& arg){
370
368
  VALUE obj=FXRbGetRubyObj(recv,false);
371
369
  FXASSERT(!NIL_P(obj));
372
- FXASSERT(!FXRbIsInGC(recv));
373
370
  rb_funcall(obj,rb_intern(func),1,to_ruby(arg));
374
371
  FXRbUnregisterBorrowedRubyObj(&arg);
375
372
  }
@@ -386,7 +383,6 @@ template<class TYPE>
386
383
  void FXRbCallVoidMethod_gvlcb(const FXObject* recv, const char *func, TYPE& arg){
387
384
  VALUE obj=FXRbGetRubyObj(recv,false);
388
385
  FXASSERT(!NIL_P(obj));
389
- FXASSERT(!FXRbIsInGC(recv));
390
386
  rb_funcall(obj,rb_intern(func),1,to_ruby(arg));
391
387
  FXRbUnregisterBorrowedRubyObj(&arg);
392
388
  }
@@ -53,19 +53,6 @@ void FXRbObject::markfunc(FXObject* obj){
53
53
  FXTRACE((100,"%s::markfunc(%p)\n",obj?obj->getClassName():"FXRbObject",obj));
54
54
  }
55
55
 
56
- static void FXRbSetInGCParentsRecursive(FXWindow *window, bool enabled){
57
- FXRbSetInGC( window, true );
58
- if(window->getParent()) FXRbSetInGCParentsRecursive( window->getParent(), enabled );
59
- }
60
-
61
- static void FXRbSetInGCChildrenRecursive(FXWindow *window, bool enabled){
62
- FXRbSetInGC( window, true );
63
- for(FXWindow* child=window->getFirst(); child; child=child->getNext()){
64
- FXRbSetInGCChildrenRecursive( child, enabled );
65
- }
66
- }
67
-
68
-
69
56
  void FXRbObject::freefunc(FXObject* self){
70
57
  if(self!=0){
71
58
  // Unregister, but don't destroy, borrowed references
@@ -78,17 +65,6 @@ void FXRbObject::freefunc(FXObject* self){
78
65
  FXASSERT(classname!=0);
79
66
  FXASSERT(strlen(classname)>3);
80
67
  if(classname[0]=='F' && classname[1]=='X' && classname[2]=='R' && classname[3]=='b'){
81
- // FXWindow destructor calls recalc() and changeFocus() of it's parent window.
82
- // Since these methods are routed back to Ruby code, but calling Ruby code from
83
- // GC isn't a good idea, we mark the parent window as "in_gc", so that it will
84
- // ignore recalc() and changeFocus() calls completely.
85
- // The parent window should also be scheduled to be free'd. In the other case,
86
- // the child window would have been marked as used.
87
- if(self->isMemberOf(FXMETACLASS(FXWindow))){
88
- FXWindow *window = dynamic_cast<FXWindow*>(self);
89
- FXRbSetInGCParentsRecursive( window, true );
90
- FXRbSetInGCChildrenRecursive( window, true );
91
- }
92
68
  delete self;
93
69
  }
94
70
  else{
data/lib/1.8/fox16_c.so CHANGED
Binary file
data/lib/1.9/fox16_c.so CHANGED
Binary file
data/lib/2.0/fox16_c.so CHANGED
Binary file
data/lib/2.1/fox16_c.so CHANGED
Binary file
data/lib/2.2/fox16_c.so CHANGED
Binary file
data/lib/fox16/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Fox
2
2
  def Fox.fxrubyversion
3
- "1.6.31"
3
+ "1.6.32.pre1"
4
4
  end
5
5
  end
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -67,12 +67,12 @@ class TC_FXTreeList < Fox::TestCase
67
67
  @treeList.connect(SEL_INSERTED) { |sender, sel, ptr|
68
68
  anItem = ptr
69
69
  }
70
- theItem = @treeList.appendItem(nil, "", nil, nil, nil, true)
70
+ theItem = @treeList.appendItem(nil, FXTreeItem.new(""), true)
71
71
  assert_same(theItem, anItem)
72
72
  end
73
73
 
74
74
  def test_SEL_DELETED
75
- theItem = @treeList.appendItem(nil, "")
75
+ theItem = @treeList.appendItem(nil, FXTreeItem.new(""))
76
76
  anItem = nil
77
77
  @treeList.connect(SEL_DELETED) { |sender, sel, ptr|
78
78
  anItem = ptr
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fxruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.31
4
+ version: 1.6.32.pre1
5
5
  platform: x86-mingw32
6
6
  authors:
7
7
  - Lyle Johnson
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-07-21 00:00:00.000000000 Z
12
+ date: 2015-08-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mini_portile
@@ -1038,9 +1038,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
1038
1038
  version: '0'
1039
1039
  required_rubygems_version: !ruby/object:Gem::Requirement
1040
1040
  requirements:
1041
- - - ">="
1041
+ - - ">"
1042
1042
  - !ruby/object:Gem::Version
1043
- version: '0'
1043
+ version: 1.3.1
1044
1044
  requirements: []
1045
1045
  rubyforge_project:
1046
1046
  rubygems_version: 2.4.8