Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » [bug report] EditField::StdBar Undo menu not checked and EditField::RightDown is reentrant
Re: [bug report] EditField::StdBar Undo menu not checked and EditField::RightDown is reentrant [message #37294 is a reply to message #37276] Sun, 16 September 2012 20:59 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14265
Registered: November 2005
Ultimate Member
jinshiyi11 wrote on Fri, 14 September 2012 02:56

1.I think Undo menu should be disabled when EditField is readonly.



Applied.

Quote:


2.When I repeat right click EditField,the EditField::RightDown method is reentrant.The stack likes the following:
index.php?t=getfile&id=3872&private=0

When I close the parent window,it may crash at the next code line.(It's easy to reproduce it in my project)

In the Upp's help document,"About modal loops and periodic timer events" has talked about this.I think EditField::RightDown should be protected.


Changed to

void EditField::RightDown(Point p, dword keyflags)
{
	keep_selection = true;
	Ptr<EditField> self = this;
	MenuBar::Execute(WhenBar);
	if(self) { // protect from destruction when in menu modal loop
		SetFocus();
		keep_selection = false;
	}
}


I hope it helps (would worth checking for other occurences of MenuBar::Execute as well).

Mirek
 
Read Message
Read Message
Read Message
Previous Topic: [bug report]DrawTextEllipsis
Next Topic: Class method called by keyboard hook callback has an empty "this" pointer
Goto Forum:
  


Current Time: Mon Jul 14 23:47:05 CEST 2025

Total time taken to generate the page: 0.03672 seconds