View Issue Details

IDProjectCategoryView StatusLast Update
0020274LazarusLCLpublic2014-09-21 18:10
ReporterSven BarthAssigned ToFelipe Monteiro de Carvalho 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version0.9.31 (SVN)Product Build 
Target VersionFixed in Version0.9.30.1 (SVN) 
Summary0020274: [WinCE] Access Violation when freeing a menu item (follow up of 0019898)
DescriptionWhen a menu item is freed that isn't part of a menu (MenuItem.Menu = Nil), but has a handle, then an access violation occurs inside TWinCEWSMenuItem.DestroyHandle.
Additional InformationAttached is a patch which solves the issue.
TagsNo tags attached.
Fixed in Revision32539
LazTarget-
WidgetsetWinCE
Attached Files
  • wincewsmenus.patch (477 bytes)
    --- C:/Downloads/wincewsmenus - Kopie.pp	Fri Sep 16 16:04:02 2011
    +++ C:/Downloads/wincewsmenus.pp	Fri Sep 16 16:04:45 2011
    @@ -918,7 +918,7 @@
     begin
       // this is the top item of a menu, so we must undo TWinCEWSMenu.CreateHandle
       // See bug 19898
    -  if AMenuItem = AMenuItem.Menu.Items then 
    +  if Assigned(AMenuitem.Menu) and (AMenuItem = AMenuItem.Menu.Items) then
       begin
         idx := MenuHandleList.IndexOf(Pointer(AMenuItem.Handle));
         if idx >= 0 then 
    
    wincewsmenus.patch (477 bytes)

Relationships

related to 0019898 resolvedFelipe Monteiro de Carvalho Lazarus [WinCE] Sometimes an access violation or a bus error occurs when creating a form with a menu 
related to 0019972 resolvedFelipe Monteiro de Carvalho Packages Crash while closing a modal window on WinCE 
related to 0026757 assignedStephano Lazarus [Patch] AV when destroying form with menu 

Activities

2011-09-16 16:09

 

wincewsmenus.patch (477 bytes)
--- C:/Downloads/wincewsmenus - Kopie.pp	Fri Sep 16 16:04:02 2011
+++ C:/Downloads/wincewsmenus.pp	Fri Sep 16 16:04:45 2011
@@ -918,7 +918,7 @@
 begin
   // this is the top item of a menu, so we must undo TWinCEWSMenu.CreateHandle
   // See bug 19898
-  if AMenuItem = AMenuItem.Menu.Items then 
+  if Assigned(AMenuitem.Menu) and (AMenuItem = AMenuItem.Menu.Items) then
   begin
     idx := MenuHandleList.IndexOf(Pointer(AMenuItem.Handle));
     if idx >= 0 then 
wincewsmenus.patch (477 bytes)

Felipe Monteiro de Carvalho

2011-09-28 10:49

developer   ~0052241

Thanks, applied

Issue History

Date Modified Username Field Change
2011-09-16 16:09 Sven Barth New Issue
2011-09-16 16:09 Sven Barth File Added: wincewsmenus.patch
2011-09-16 16:09 Sven Barth LazTarget => -
2011-09-16 16:09 Sven Barth Widgetset => WinCE
2011-09-28 10:44 Felipe Monteiro de Carvalho Relationship added related to 0019898
2011-09-28 10:45 Felipe Monteiro de Carvalho Relationship added related to 0019972
2011-09-28 10:49 Felipe Monteiro de Carvalho Fixed in Revision => 32539
2011-09-28 10:49 Felipe Monteiro de Carvalho Status new => resolved
2011-09-28 10:49 Felipe Monteiro de Carvalho Fixed in Version => 0.9.30.1 (SVN)
2011-09-28 10:49 Felipe Monteiro de Carvalho Resolution open => fixed
2011-09-28 10:49 Felipe Monteiro de Carvalho Assigned To => Felipe Monteiro de Carvalho
2011-09-28 10:49 Felipe Monteiro de Carvalho Note Added: 0052241
2014-09-21 18:10 Juha Manninen Relationship added related to 0026757