PR# 5349 Creating EV_APPLICATION leaks memory

Problem Report Summary
Submitter: prestoat2000
Category: EiffelVision
Priority: Medium
Date: 2005/08/05
Class: Bug
Severity: Serious
Number: 5349
Release: 5.6.1128
Confidential: No
Status: Analyzed
Responsible: misterieking
Environment: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.4) Gecko/20030625 SunOS 5.9 Generic_118558-10 sun4u sparc SUNW,Sun-Blade-1000
Synopsis: Creating EV_APPLICATION leaks memory

Creating an EV_APPLICATION leaks memory.
    The memory is allocated by the following line in {EV_APPLICATION_IMP}.make
        tooltips := {EV_GTK_EXTERNALS}.gtk_tooltips_new

Also, it seems to be that the following sequence should work
but it violates a precondition:


    create app
    -- Do some non-graphical stuff
    create app

Please fix if this is a bug or tell me why I can't do this.
To Reproduce
See above.
Problem Report Interactions
From:manus_eiffel    Date:2009/08/14    Download   
On Unix, it does not seem to be any Eiffel leak, only GTK related one. I'll let Ian look at that more closely. What I found so far is that for a few, we call free some memory in EV_APPLICATION_IMP.destroy, but this is not enough to fix the allocated memory by GTK.

From:manus_eiffel    Date:2009/08/14    Download   
This is fixed on Windows at rev#80284.

From:prestoat2000    Date:2009/01/21    Status: Analyzed    Download   
This may have been fixed in 5.6 but the problem seems to be back in 6.3.76070
on Solaris 10 SPARC.  I have attached new files test1.e and test1.ecf.
If I compile with them and run, a precondition is violated:

EV_ENVIRONMENT_IMP  set_application @2     application_not_already_set:
<0000000003E3E6D0>  (From EV_ENVIRONMENT_I)
                                           Precondition violated.        Fail

If I disable all assertions and execute system, memory usage keeps growing,
apparently without bound.

Attachment: test1.e     Size:299
Attachment: test1.ecf     Size:1274
From:prestoat2000    Date:2005/08/05    Download   
==== Ian: Wed Aug  3 13:13:42 PDT 2005 ===============================

Hi David,

This should now be fixed, thanks.

==== Ian: Wed Aug  3 13:13:42 PDT 2005 ===============================
Subject: Re: EiffelVision_2/5349: Creating EV_APPLICATION leaks memory
Date: Fri, 5 Aug 2005 11:58:09 -0700 (PDT)

 The memory leak part of this bug report indeed seems to be fixed.
 However, when I try to create an EV_APPLICATION, launch it, destroy it
 and then create it again, the second creation attempt violates
 precondition "application_not_already_set" of EV_ENVIRONMENT_IMP.
 I don't see why I can't create a second application after the
 first one has exited (possibly with some non-grapical processing
 in between).  We may actually want to do this.
 Is this just a design limitation or a GTK+ limitation or can it be fixed?
 EV_ENVIRONMENT_IMP  set_application @4     applicatio
Output truncated, Click download to get the full message