Ruby.exe crashing with WIN32OLE WMI example?

Class WMI COM without class register

try with next command lines:

C:>
C:>cd c:\winnt\system32\wbem
C:\WINNT\system32\wbem>
C:\WINNT\system32\wbem> for %a in (*.dll) do regsvr32 %a

–.Pinelo.

“MikkelFJ” <mikkelfj-antisp@dvide-antisp.com (rm -antisp)> wrote in message news:3ffb0da3$0$30089$edfadb0f@dtext01.news.tele.dk…

···

“yonatan” yonatan_avraham@hotmail.com skrev i en meddelelse
news:37fcf3c0.0401060555.7ab8a404@posting.google.com

Regarding Botp’s configuration using Windows XP…

I’m trying to do some WMI stuff with Ruby. I found this
simple example somewhere. It works – until the program
exists that is.
Then Windows pops up a “ruby.exe - Application Error” message
box due to inappropriate memory access.

…I just installed Ruby 1.8 on an Windows XP box and the WMI example
works fine. I then installed it on another Windows 2000 box and the
WMI example crashes. Any ideas?

The fact that it crashes on application exit seems to indicate a problem
with reference counting where an object is being deleted after it has
already been deleted once. The Ruby GC will collect all live objects on exit
and this is why the problem shows up here. Only a suggestion of course.
Why it works on one OS and not on another is difficult answer.
Also it doesn’t answer why a reference count error might happen in the first
place.
Except if there is a bug in either the Ruby impl. or in the WMI COM objects
implementation.

Regards

MikkelFJ