Thanks to visit codestin.com
Credit goes to github.com

Skip to content

View related memory leak (handle-events). #45

@Oldes

Description

@Oldes

Each call to view without providing own handler is adding the default view handler into handlers block here:

r3/src/mezz/view-funcs.r

Lines 76 to 96 in baf7e6c

; Set up default handler, if user did not provide one:
unless opts/handler [
handle-events [
name: 'view-default
priority: 50
handler: func [event] [
print ["view-event:" event/type event/offset]
if switch event/type [
close [true]
key [event/key = escape]
][
unhandle-events self
unview event/window
quit
]
show event/window
none ; we handled it
]
]
]
]

The default handler should be added only once or the handle-events function should replace handler with same name as the new one instead of adding it multiple times.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions