nobody at rubyforge.org
2007-Mar-17 18:43 UTC
[Wxruby-development] [887] branches/wxruby2/wxwidgets_282/swig/fixdeleting.rb: Deleting fix for specific Director classes (Artur Kuptel)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!-- #msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; } #msg dt { float: left; width: 6em; font-weight: bold; } #msg dt:after { content:'':'';} #msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; } #msg dl a { font-weight: bold} #msg dl a:link { color:#fc3; } #msg dl a:active { color:#ff0; } #msg dl a:visited { color:#cc6; } h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; } #msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; } #msg ul, pre { overflow: auto; } #header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; } #patch { width: 100%; } #patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;} #patch .propset h4, #patch .binary h4 {margin:0;} #patch pre {padding:0;line-height:1.2em;margin:0;} #patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;} #patch .propset .diff, #patch .binary .diff {padding:10px 0;} #patch span {display:block;padding:0 10px;} #patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;} #patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;} #patch .lines, .info {color:#888;background:#fff;} --></style> <title>[887] branches/wxruby2/wxwidgets_282/swig/fixdeleting.rb: Deleting fix for specific Director classes (Artur Kuptel)</title> </head> <body> <div id="msg"> <dl> <dt>Revision</dt> <dd>887</dd> <dt>Author</dt> <dd>brokentoy</dd> <dt>Date</dt> <dd>2007-03-17 14:43:05 -0400 (Sat, 17 Mar 2007)</dd> </dl> <h3>Log Message</h3> <pre>Deleting fix for specific Director classes (Artur Kuptel)</pre> <h3>Modified Paths</h3> <ul> <li><a href="#brancheswxruby2wxwidgets_282swigfixdeletingrb">branches/wxruby2/wxwidgets_282/swig/fixdeleting.rb</a></li> </ul> </div> <div id="patch"> <h3>Diff</h3> <a id="brancheswxruby2wxwidgets_282swigfixdeletingrb"></a> <div class="modfile"><h4>Modified: branches/wxruby2/wxwidgets_282/swig/fixdeleting.rb (886 => 887)</h4> <pre class="diff"><span> <span class="info">--- branches/wxruby2/wxwidgets_282/swig/fixdeleting.rb        2007-03-17 18:41:43 UTC (rev 886) +++ branches/wxruby2/wxwidgets_282/swig/fixdeleting.rb        2007-03-17 18:43:05 UTC (rev 887) </span><span class="lines">@@ -30,7 +30,7 @@ </span><span class="cx">         skip_deleter_fix = false </span><span class="cx">          </span><span class="cx">         director_class = nil </span><del>- </del><ins>+        director_class_name = "SwigDirector_#{wx_name}" </ins><span class="cx">         File.foreach(broken) do | line | </span><span class="cx"> </span><span class="cx">                 # if we found our director class constructor, </span><span class="lines">@@ -51,6 +51,11 @@ </span><span class="cx">                 # in the Director constructor, </span><span class="cx"> if(line.index("Director(VALUE self")) </span><span class="cx">                         # make a note of this object </span><ins>+                        found_director_constructor = true +                end +                # class specific constructor +        if(line.index(director_class_name+"::"+director_class_name)) +                        # make a note of this object </ins><span class="cx">                         lines = [line] </span><span class="cx">                         lines << ''#ifdef wxDEBUG'' </span><span class="cx">                         lines << '' printf("'' + this_module + ''" " new Director %p\n", this);'' </span><span class="lines">@@ -60,10 +65,11 @@ </span><span class="cx">                         line = lines.join("\n") </span><span class="cx">                         found_director_constructor = true </span><span class="cx">                 end </span><del>- -                # in the Director destructor, - if(line.index("~Director()")) </del><ins>+        if(line.index("~"+director_class_name)) </ins><span class="cx">                         # make a note that this object has been deleted </span><ins>+                        # it''s done in class specific destructor +                        # because multiple inheritance causes +                        # this!=(Director *)this in some compilers </ins><span class="cx">                         lines = [line] </span><span class="cx">                         lines << ''#ifdef wxDEBUG'' </span><span class="cx">                         lines << '' printf("'' + this_module + ''" " ~Director %p\n", this);'' </span><span class="lines">@@ -73,25 +79,27 @@ </span><span class="cx"> lines << '' rb_ivar_set(rb_obj, rb_intern("@__swig_dead__"), Qtrue);'' </span><span class="cx">                         lines << '' GcMarkDeleted(this);'' </span><span class="cx">                         line = lines.join("\n") </span><ins>+                end +                # in the Director destructor, + if(line.index("~Director()")) </ins><span class="cx">                         found_director_destructor = true </span><del>- end </del><ins>+         end </ins><span class="cx"> </span><span class="cx">                 # where the C++ object was being deleted, </span><span class="cx"> if(line.index("delete arg1") && !skip_deleter_fix && director_class) </span><span class="cx">                         lines = [] </span><del>-                        lines << " Swig::Director* director = (Swig::Director*)(#{director_class}*)arg1;" </del><span class="cx">                         lines << ''#ifdef wxDEBUG'' </span><del>-                        lines << '' printf("'' + this_module + ''" " Checking %p\n", director);'' </del><ins>+                        lines << '' printf("'' + this_module + ''" " Checking %p\n", arg1);'' </ins><span class="cx">                         lines << ''#endif'' </span><del>-                        lines << " if (GcIsDeleted(director))" </del><ins>+                        lines << " if (GcIsDeleted(arg1))" </ins><span class="cx">                         lines << " {" </span><span class="cx">                         lines << ''#ifdef wxDEBUG'' </span><del>-                        lines << " printf(\"%p is already dead!\\n\", director);" </del><ins>+                        lines << " printf(\"%p is already dead!\\n\", arg1);" </ins><span class="cx">                         lines << ''#endif'' </span><span class="cx">                         lines << " return;" </span><span class="cx">                         lines << " }" </span><span class="cx">                         lines << ''#ifdef wxDEBUG'' </span><del>-                        lines << " printf(\"deleting %p\\n\", director);" </del><ins>+                        lines << " printf(\"deleting %p\\n\", arg1);" </ins><span class="cx">                         lines << " fflush(stdout);" </span><span class="cx">                         lines << ''#endif'' </span><span class="cx">                         lines << " delete arg1;" </span></span></pre> </div> </div> </body> </html>
Reasonably Related Threads
- [890] branches/wxruby2/wxwidgets_282/swig/fixdeleting.rb: Fix crash on exit (Artur Kuptel)
- [1070] trunk/wxruby2/swig/fixdeleting.rb: Remove old, now unused, fixdeleting script
- [888] branches/wxruby2/wxwidgets_282/swig/shared/treeitemid_typemaps.i: Fix compile warning for TreeItemId typemap (Artur Kuptel)
- [886] branches/wxruby2/wxwidgets_282/swig/fixevents.rb: Mouse events fix for Win32 (Artur Kuptel)
- [889] branches/wxruby2/wxwidgets_282/swig/shared/control_with_items.i: Ensure SWIG doesn''t generate wrappers for client data methods (Artur Kuptel)