Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » GridCtrl: Assert Crash due to out of focus Remove  
	
		
		
			| GridCtrl: Assert Crash due to out of focus Remove [message #59852] | 
			Thu, 04 May 2023 17:41   | 
		 
		
			
				
				
				
					
						  
						devilsclaw
						 Messages: 74 Registered: August 2022 
						
					 | 
					Member  | 
					 | 
		 
		 
	 | 
 
	
		So I have a program and does an update to a target device and when that device finishes the update it remove the associated GridCtrl row with the Remove method. 
 
During the update process a new window is popped up which is the transfer tracker. this make the main window out of focus. When the update is done and the main frame is out of focus and the GridCtrl row is removed, at this point nothing seems wrong. 
 
Then I click back on the main window and I get VCount out of bound assert, since the current valid cursor points to an invalid row.  
 
GridCtrl::RefreshRow 
 
I tried to add 
  if(n >= vitems.GetCount()) {
    return;
  }
 
 
which worked until I tried to close the program and then 
 
Upp::GridCtrl::UpdateCtrls(int) is triggered and it has and invalid curpos or oldcur 
 
from this 
Point cp(opt & UC_OLDCUR ? oldcur : curpos);
  
 
		
		
		
 |  
	| 
		
	 | 
 
 
 |  
  
 
Goto Forum:
 
 Current Time: Tue Nov 04 14:05:47 CET 2025 
 Total time taken to generate the page: 0.10985 seconds 
 |