Commit 26b8fd97 authored by John Ballance's avatar John Ballance
Browse files

Fixed small memory leak in Wimp09 when adding and removing messages

	use of R3 value in OS_Module extend block entry was incorrect..
	it was used as absolute size required, should be changed size required.
	resulted in wrong block re-sizing.

	castle added IP.

Version 4.96. Tagged as 'Wimp-4_96'
parent 4d670cf4
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "4.95"
Module_Version SETA 495
Module_MajorVersion SETS "4.96"
Module_Version SETA 496
Module_MinorVersion SETS ""
Module_Date SETS "11 Sep 2005"
Module_ApplicationDate SETS "11-Sep-05"
Module_Date SETS "05 Jan 2006"
Module_ApplicationDate SETS "05-Jan-06"
Module_ComponentName SETS "Wimp"
Module_ComponentPath SETS "RiscOS/Sources/Desktop/Wimp"
Module_FullVersion SETS "4.95"
Module_HelpVersion SETS "4.95 (11 Sep 2005)"
Module_FullVersion SETS "4.96"
Module_HelpVersion SETS "4.96 (05 Jan 2006)"
/* (4.95)
/* (4.96)
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.2.
#define Module_MajorVersion_CMHG 4.95
#define Module_MajorVersion_CMHG 4.96
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 11 Sep 2005
#define Module_Date_CMHG 05 Jan 2006
#define Module_MajorVersion "4.95"
#define Module_Version 495
#define Module_MajorVersion "4.96"
#define Module_Version 496
#define Module_MinorVersion ""
#define Module_Date "11 Sep 2005"
#define Module_Date "05 Jan 2006"
#define Module_ApplicationDate "11-Sep-05"
#define Module_ApplicationDate "05-Jan-06"
#define Module_ComponentName "Wimp"
#define Module_ComponentPath "RiscOS/Sources/Desktop/Wimp"
#define Module_FullVersion "4.95"
#define Module_HelpVersion "4.95 (11 Sep 2005)"
#define Module_LibraryVersionInfo "4:95"
#define Module_FullVersion "4.96"
#define Module_HelpVersion "4.96 (05 Jan 2006)"
#define Module_LibraryVersionInfo "4:96"
......@@ -644,14 +644,15 @@ addmoremessages
Push "R3"
MOV R0,#ModHandReason_ExtendBlock
ADD R3,R1,R5
MOV r3, r5 ; jb/ma 4/1/06 r5 is already the extra space required
; ADD R3,R1,R5
BL XROS_Module ; attempt to extend it
Pull "R3" ; preserve the list pointer
Debug msgsel,"extended message block at, size =",R2,R1
MOV R6,R1 ; extending boundary
MOV R6,R1 ; extending boundary (old message size)
30 LDR R7,[R3],#4 ; get a value from the list
TEQ R7,#0
......@@ -671,15 +672,19 @@ addmoremessages
BNE %BT40 ; loop back until found
B %BT30 ; if it doesn't then try another entry
50 MOV R3,R6
MOV R0,#ModHandReason_ExtendBlock
BL XROS_Module ; reduce back to a meaningful size
50 SUBS r3, r6, r5 ; jb/ma 4/1/06 check what we did not use
; and give back any unused
; MOV R3,R6
MOVNE R0,#ModHandReason_ExtendBlock
BLNE XROS_Module ; reduce back to a meaningful size
Debug msgsel,"after block truncate: at, size =",R2,R3
Debug msgsel,"after block truncate: at, change =,size =",R2,R3,R6
STR R2,[R4,#task_messages] ; update to contian new size
STR R3,[R4,#task_messagessize]
STR R2,[R4,#task_messages] ; update to contain new size
STR R6,[R4,#task_messagessize] ; jb/ma 4/1/06 this is the actual size
; r3 is only the change in size
; STR R3,[R4,#task_messagessize]
Debug msgsel,"sort list at, size =",R2,R3
......@@ -789,15 +794,16 @@ removemessages Entry "R1-R2,R4-R8"
SUB R6,R6,#4
B %BT10 ; and try again until whole list scanned
STR R6,[R4,#task_messagessize]
LDR R3,[R4,#task_messagessize] ; old size
STR R6,[R4,#task_messagessize] ; new size
SUBS R3,R6,R3 ; compute changed size needed
LDR R2,[R4,#task_messages]
MOV R0,#ModHandReason_ExtendBlock
BL XROS_Module ; attempt to reduce the block size
STRVC R2,[R4,#task_messages] ; and then store updated block pointer
Debug msgsel,"after extend block: size of list =",R2,R3
Debug msgsel,"after extend block: size of list =",R2,R6
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment