bugDotGNU Portable.NET - Bugs: bug #10392, Control.ContainsFocus causes an...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #10392: Control.ContainsFocus causes an stack overflow

Submitted by:  None
Submitted on:  Wed 15 Sep 2004 07:47:39 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Wed 15 Sep 2004 11:02:58 PM UTC, comment #1:

Fix committed to CVS - 16 Sep 2004

Rhys Weatherley <rweather>
Project Administrator
Wed 15 Sep 2004 07:47:39 AM UTC, original submission:

If U derive a class from control and overwrite the get property Focused and then call ContainsFocus within this U'll get an StackOverflow.
Try this:
public class MyControl : public Control
{
public override bool Focused
{
get
{
return this.ContainsFocus;
}
}
}

if U call MyControl.Focused -> Stack Overflow.

I did a quickhack in Control.cs:

public bool ContainsFocus
{
get
{
// Heiko Weiss, do not call Focused, maybe some derived classes overwrite Focused
if(toolkitWindow != null && toolkitWindow.Focused) return true;

/* Do not do the following lines
if (Focused)
{
return true;
}
*/
for (int i = 0; i < numChildren; i++)
{
if (children[i].ContainsFocus)
{
return true;
}
}
return false;
}
}

Anonymous

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 2 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Wed 15 Sep 2004 11:02:58 PM UTCrweatherStatusNone=>Fixed
  Open/ClosedOpen=>Closed

Back to the top


Powered by Savane 3.1-cleanup1