Modify

Opened 16 years ago

Closed 14 years ago

#1319 closed Bug (Fixed)

AutoIt3.exe always exists after closing script with RichEdit

Reported by: BugFix Owned by: trancexx
Milestone: 3.3.9.1 Component: AutoIt
Version: 3.3.1.6 Severity: None
Keywords: Cc:

Description

Hi,
i've used in SciTE the following script with Windows XP Home SP2. At first with Beta 3.1.1.5 .
After ending exists furthermore process AutoIt3.exe with an CPU load of 98 %.
Then i've updated to Beta 3.3.1.6 with same effect.

#include <EditConstants.au3>
#include <GuiRichEdit.au3>

$Form1 = GUICreate("Form1", 400, 500, 300, 220)
$Edit = _GUICtrlRichEdit_Create($Form1, "", 10, 10, 380, 360, BitOR($ES_MULTILINE, $ES_AUTOVSCROLL))
GUISetState(@SW_SHOW)

Do
Until GUIGetMsg() = -3

Attachments (0)

Change History (11)

comment:1 by anonymous, 16 years ago

Nearly the same on Windows 7. But on seven the Script just fatal exit:
!>17:57:55 AutoIT3.exe ended.rc:-1073741819

No CPU load.

comment:2 by ProgAndy, 16 years ago

this is a workaround working on xp:

;#BETA
#include <EditConstants.au3>
#include <GuiRichEdit.au3>

OnAutoItExitRegister("KillRichEdit")

$Form1 = GUICreate("Form1", 400, 500, 300, 220)
$Edit = _GUICtrlRichEdit_Create($Form1, "", 10, 10, 380, 360, BitOR($ES_MULTILINE, $ES_AUTOVSCROLL))
GUISetState(@SW_SHOW)

Do
Until GUIGetMsg() = -3

Func KillRichEdit()
	_GUICtrlRichEdit_Destroy($Edit)
EndFunc

comment:3 by ProgAndy, 16 years ago

Found the error:
I think it is __GCR_SetOLECallback($hRichEdit) wich is called in _GUICtrlRichEdit_Create.
When AutoIt is being closed, the callbacks or the dllstructs are freed before the RichEdit was destroyed. The Richedit tries to call the release function of the "object", but since it does not exist anymore, this leads to unexpected behaviour.

It should be documented that you have to use _GUICtrlRichEdit_Destroy on exit. Also, the COM-Object should not be initialised for each richedit. Sometimes a RichEdit without image-support is needed. I propose to remove __GCR_SetOLECallback from the create function and document instead that you have to call an other function for image support.

comment:4 by Valik, 16 years ago

This ticket is referenced in revision: [5442]

comment:5 by J-Paul Mesnage, 16 years ago

Resolution: Fixed
Status: newclosed
Version: 3.3.1.63.3.2.0

comment:6 by TicketCleanup, 16 years ago

Milestone: Future Release

Automatic ticket cleanup.

comment:7 by Valik, 16 years ago

Milestone: Future Release
Resolution: Fixed
Status: closedreopened
Version: 3.3.2.03.3.1.6

If I wanted this ticket closed I would have closed this ticket.

comment:8 by anon, 16 years ago

I propose to remove GCR_SetOLECallback from the create function and document instead that you have to call an other function for image support.

I agree, I haven't done thorough testing, but calling GCR_SetOLECallback() after the control is created works just as well. And it runs just as good without it.

 _GUICtrlRichEdit_EnableOLE($fEnabled = True)

Could be used to enable the ole (image etc support)

comment:9 by J-Paul Mesnage, 16 years ago

Owner: set to Valik
Status: reopenedassigned

comment:10 by J-Paul Mesnage, 16 years ago

Not sure to understand what must be done in _GUICtrlRichEdit_EnableOLE( False) after usage of a successful _GUICtrlRichEdit_EnableOLE( True)

comment:11 by trancexx, 14 years ago

Milestone: 3.3.9.1
Owner: changed from Valik to trancexx
Resolution: Fixed
Status: assignedclosed

Fixed by revision [6805] in version: 3.3.9.1

Modify Ticket

Action
as closed The owner will remain trancexx.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.