rogue window instances

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

rogue window instances

Tudor Girba-2
Hi,

In the latest Pharo #50125, I do this from the command line:

./pharo Pharo.image eval "SystemWindow allSubInstances"
==>
an OrderedCollection(a RubFindReplaceDialogWindow(534511616) a GLMSystemWindow(58720256))

There are two strange things:
- the GLMSystemWindow has a nil model, although if you inspect it, it visually looks like a Playground window (normal playgrounds have a GTPlayground instance as model).
- the RubFindReplaceDialogWindow has findTextField as nil (while normally it should be some PluggableTextFieldMorph).

Does anyone know where these come from?

Cheers,
Doru


--

"Every thing has its own flow"
Reply | Threaded
Open this post in threaded view
|

Re: rogue window instances

stepharo


Le 21/6/15 19:47, Tudor Girba a écrit :
Hi,

In the latest Pharo #50125, I do this from the command line:

./pharo Pharo.image eval "SystemWindow allSubInstances"
==>
an OrderedCollection(a RubFindReplaceDialogWindow(534511616) a GLMSystemWindow(58720256))

There are two strange things:
- the GLMSystemWindow has a nil model, although if you inspect it, it visually looks like a Playground window (normal playgrounds have a GTPlayground instance as model).
- the RubFindReplaceDialogWindow has findTextField as nil (while normally it should be some PluggableTextFieldMorph).

Does anyone know where these come from?

It may be related to the changes I did that removes the use of this ugly
    findDeeplyMorphSuchThat: [:e | e isKindOf: PluggbaleTextMorph and: [ e respondsTo: xxxx ]
We should ban such methods.

Stef

Cheers,
Doru


--

"Every thing has its own flow"

Reply | Threaded
Open this post in threaded view
|

Re: rogue window instances

stepharo
In reply to this post by Tudor Girba-2
Doru

this is strange because it seems that each time I open an inspector I get a new GLMSystemWindow.
Are you holding a reference in Playgorund or inspector?

I tried to use pointer to but no chance.

Stef

Le 21/6/15 19:47, Tudor Girba a écrit :
Hi,

In the latest Pharo #50125, I do this from the command line:

./pharo Pharo.image eval "SystemWindow allSubInstances"
==>
an OrderedCollection(a RubFindReplaceDialogWindow(534511616) a GLMSystemWindow(58720256))

There are two strange things:
- the GLMSystemWindow has a nil model, although if you inspect it, it visually looks like a Playground window (normal playgrounds have a GTPlayground instance as model).
- the RubFindReplaceDialogWindow has findTextField as nil (while normally it should be some PluggableTextFieldMorph).

Does anyone know where these come from?

Cheers,
Doru


--

"Every thing has its own flow"

Reply | Threaded
Open this post in threaded view
|

Re: rogue window instances

stepharo
In reply to this post by Tudor Girba-2


Le 21/6/15 19:47, Tudor Girba a écrit :
Hi,

In the latest Pharo #50125, I do this from the command line:

./pharo Pharo.image eval "SystemWindow allSubInstances"
==>
an OrderedCollection(a RubFindReplaceDialogWindow(534511616) a GLMSystemWindow(58720256))

There are two strange things:
- the GLMSystemWindow has a nil model, although if you inspect it, it visually looks like a Playground window (normal playgrounds have a GTPlayground instance as model).
- the RubFindReplaceDialogWindow has findTextField as nil (while normally it should be some PluggableTextFieldMorph).
The RubFindReplaceDialogWindow only get its findTextField when the morph is built.

newMainPanel
    "Answer a new main panel."

    ^self newDialogPanel
        addMorphBack: self newContentMorph;
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


        addMorphBack: self newButtonRow;
        yourself

newContentMorph
    ^(self newColumn: {   
            (self newGroupbox: nil for:
                (self newColumn: {
                    self newFindTextEntryMorph.
                    (self newRow: {
                        (self newColumn: {
                            (self newCheckboxFor: self getSelected: #isRegex setSelected: #isRegex: getEnabled: nil label: 'Regular expression' translated help: nil).
                            (self newCheckboxFor: self getSelected: #caseSensitive setSelected: #caseSensitive: getEnabled: nil label: 'Case sensitive' translated help: nil).
                            (self newCheckboxFor: self getSelected: #entireWordsOnly setSelected: #entireWordsOnly: getEnabled: nil label: 'Entire words only'  translated help: nil) }
                        ).
                        (self newColumn: {
                            (self newCheckboxFor: self getSelected: #searchBackwards setSelected: #searchBackwards: getEnabled: nil label: 'Search backwards'  translated help: nil).
                            (self newCheckboxFor: self getSelected: #wrapAround setSelected: #wrapAround: getEnabled: nil label: 'Wrap around'  translated help: nil) }
                        ) }   
                    ) }
                )
            ).
            (self newLabelGroup: {'Replace with: ' translated -> self newReplaceTextEntryMorph}) vResizing: #shrinkWrap}
        )


newFindTextEntryMorph
    | entryCompletion pt |
    entryCompletion := EntryCompletion new
                dataSourceBlock: [:currText | self prevFinds ];
                filterBlock: [:currApplicant :currText | currText size = 0
                        or: [currApplicant asUppercase includesSubstring: currText asString asUppercase]].
    pt := (self newAutoAcceptTextEntryFor: self
            get: #findText
            set: #findText:
            class: String
            getEnabled: nil
            help: 'Enter the text to find' translated
            entryCompletion: entryCompletion)
        acceptOnCR: false;
        ghostText: 'Text to find';
        withDropListButton;
        crAction: [:t | self find];
        yourself.
    pt textMorph
        autoFit: true;
        wrapFlag: false;
        margins: (2@1 corner: 2@1).
    textFieldMorph := pt.
    ^ pt


We could initialize and set the variable to the "pt" and avoid to have to do it in the newFindTextEntryMorph but I do not see what we would gain.


Does anyone know where these come from?

Cheers,
Doru


--

"Every thing has its own flow"

Reply | Threaded
Open this post in threaded view
|

Re: rogue window instances

stepharo
In reply to this post by Tudor Girba-2
Doru I checked and I think that we have a memory leak with SystemWindow
I checked and we have the same in Pharo 40.
In Pharo 50 after many Smalltalk garbageCollectMost I get 5 windows.
when I get only one open.
Le 21/6/15 19:47, Tudor Girba a écrit :
Hi,

In the latest Pharo #50125, I do this from the command line:

./pharo Pharo.image eval "SystemWindow allSubInstances"
==>
an OrderedCollection(a RubFindReplaceDialogWindow(534511616) a GLMSystemWindow(58720256))

There are two strange things:
- the GLMSystemWindow has a nil model, although if you inspect it, it visually looks like a Playground window (normal playgrounds have a GTPlayground instance as model).
- the RubFindReplaceDialogWindow has findTextField as nil (while normally it should be some PluggableTextFieldMorph).

Does anyone know where these come from?

Cheers,
Doru


--

"Every thing has its own flow"

Reply | Threaded
Open this post in threaded view
|

Re: rogue window instances

stepharo


Le 24/6/15 21:44, stepharo a écrit :
Doru I checked and I think that we have a memory leak with SystemWindow
I checked and we have the same in Pharo 40.
In Pharo 50 after many Smalltalk garbageCollectMost I get 5 windows.
I was in Pharo 40 in fact.

when I get only one open.
Le 21/6/15 19:47, Tudor Girba a écrit :
Hi,

In the latest Pharo #50125, I do this from the command line:

./pharo Pharo.image eval "SystemWindow allSubInstances"
==>
an OrderedCollection(a RubFindReplaceDialogWindow(534511616) a GLMSystemWindow(58720256))

There are two strange things:
- the GLMSystemWindow has a nil model, although if you inspect it, it visually looks like a Playground window (normal playgrounds have a GTPlayground instance as model).
- the RubFindReplaceDialogWindow has findTextField as nil (while normally it should be some PluggableTextFieldMorph).

Does anyone know where these come from?

Cheers,
Doru


--

"Every thing has its own flow"


Reply | Threaded
Open this post in threaded view
|

Re: rogue window instances

Tudor Girba-2
Hi,

Thanks for looking into this. I will go over this issue again on Monday.

Cheers,
Doru



On Thu, Jun 25, 2015 at 6:53 AM, stepharo <[hidden email]> wrote:


Le 24/6/15 21:44, stepharo a écrit :
Doru I checked and I think that we have a memory leak with SystemWindow
I checked and we have the same in Pharo 40.
In Pharo 50 after many Smalltalk garbageCollectMost I get 5 windows.
I was in Pharo 40 in fact.

when I get only one open.
Le 21/6/15 19:47, Tudor Girba a écrit :
Hi,

In the latest Pharo #50125, I do this from the command line:

./pharo Pharo.image eval "SystemWindow allSubInstances"
==>
an OrderedCollection(a RubFindReplaceDialogWindow(534511616) a GLMSystemWindow(58720256))

There are two strange things:
- the GLMSystemWindow has a nil model, although if you inspect it, it visually looks like a Playground window (normal playgrounds have a GTPlayground instance as model).
- the RubFindReplaceDialogWindow has findTextField as nil (while normally it should be some PluggableTextFieldMorph).

Does anyone know where these come from?

Cheers,
Doru


--

"Every thing has its own flow"





--

"Every thing has its own flow"