Re: Possible bug with PHP + GTK + COM on Win32
| From: | Scott Hurring | Date: | Fri, 21 Mar 2003 19:28:34 +0000 |
| Subject: | Re: Possible bug with PHP + GTK + COM on Win32 | ||
| References: | 1 2 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-3138@lists.php.net to get a copy of this message | ||
I haven't had a chance to look at your source code yet, but i think i've
tracked the offending code down to this snippet from my Excel Class:
$this->book = $this->excel->Workbooks->Open($file);
When GTK is loaded:
If i comment out that line, EXCEL.EXE removes itself from memory
after script termination like a good process.
If i leave the line in there, EXCEL.EXE will stay resident in memory
after script termination
When GTK is NOT loaded:
EXCEL.EXE removes itself from memory always.
So to my eyes, it seems that there's a direct correlation between the
status of php_gtk.dll and the status of EXCEL.EXE... it only seems
to stay in memory when a sheet is file is opened *and* GTK is loaded.
Simply starting the COM process and then terminating it (without
opening any files) will ensure EXCEL.EXE properly terminates.
--
Scott Hurring <scotth at eac dot com>
Systems Programmer
EAC Corporation
---
"Aaron Bishell" <aragorn@gamer.net.nz> wrote in message
news:20030320232108.38904.qmail@pb1.pair.com...
> Ive written a program which uses a COM object GnucDNA (www.gnucleus.net).
> I don't know if this will be of any use but AFAIK its not remaining in
> memory after close the application. The project homepage is here:
>
> http://novap2p.sf.net/
>
> network.php handles the COM object but my code looks to be very similar to
> yours when destroying the object.
>
> Scott Hurring wrote:
>
> > Hello everyone:
>
> > (I've been using PHP for a couple years now but only recently started
> > using GTK). I'm writing an app for Win32 that will access MS Excel thru
> > its COM interface, i'm running into some seeming conflicts between GTK
> > and COM. I'm not sure if this is the best place for this, but please bear
> > with me...
>
> > Software:
> > PHP version 4.3.0-dev
> > gtkdev 0.5.1 installer for Win32
>
> > Test script code and other notes can be found here:
> > http://hurring.com/info/php/com_gtk_issues/
>
> > Problem:
> > "EXCEL.EXE" stays resident in memory even after my script exits.
> > I have a GTK front-end that is accessing MS Excel thru its COM interface,
> > after the script terminates "EXCEL.EXE" stays resident in memory.
> > It seems to only stay in memory when 'gtk_php.dll' is loaded.
>
> > Why i'm posting this to a GTK list:
> > I wrote a bunch of stripped-down non-GTK test scripts to try and see how
> > and where the Excel problem arises... and all of my non-GTK test scripts
> > work perfectly (e.g. EXCEL.EXE exits after the script terminates).
> > However, adding the line: dl("php_gtk." . (strstr(PHP_OS, "WIN") ?
> > "dll" :
> > "so"));
> > to a correctly-functioning script will cause "EXCEL.EXE" to remain
> > in memory after script termination. The php_gtk.dll library *seems* to be
> > (at least partially) responsible for EXCEL.EXE not terminating correctly,
> > becuase the sole determinant of EXCEL.EXE staying resident in memory
> > seems to be the dl(...) line.
>
> > Has anyone here ever used GTK and COM in the same program?
> > Have you had problems with COM objects hanging around past
> > script termination?
>
> > I had thought originally that maybe i wasn't destroying GTK widgets
> > properly, but the test script never builds any GUI widgets, yet
> > still exhibits the EXCEL.EXE resident problem.
>
> > Thanks in advance,
> > --
> > Scott Hurring <scotth at eac dot com>
> > Systems Programmer
> > EAC Corporation
> > ---
>
>