What's ownership of pixmap parameter for `SCI_MARKERDEFINEPIXMAP`?

16 views
Skip to first unread message

Victor T

unread,
Sep 11, 2024, 5:15:36 PM9/11/24
to scite-interest
Hi,

Just a quick question, I was wondering whether `SCI_MARKERDEFINEPIXMAP` steals a reference to the pixmap passed in or if it makes a copy? I checked https://scintilla.org/ScintillaDoc.html#SCI_MARKERDEFINEPIXMAP and also looked at `MarkerDefinePixmap` in ScintillaCall.cxx but it wasn't really obvious what the expected convention is suppose to be.

Thanks

Victor T

unread,
Sep 11, 2024, 7:57:38 PM9/11/24
to scite-interest

I mainly just need to know if it's okay for the caller to deallocate `pixmap` (xpm) after the call to ` SCI_MARKERDEFINEPIXMAP ` or will this result in undefined behavior?

Neil Hodgson

unread,
Sep 12, 2024, 4:11:40 AM9/12/24
to scite-interest
Victor T:

> I mainly just need to know if it's okay for the caller to deallocate `pixmap` (xpm) after the call to ` SCI_MARKERDEFINEPIXMAP `

Yes.

> Just a quick question, I was wondering whether `SCI_MARKERDEFINEPIXMAP` steals a reference to the pixmap passed in or if it makes a copy?

It makes a copy.

Neil

Reply all
Reply to author
Forward
0 new messages