Skip to content
This repository has been archived by the owner on Feb 10, 2024. It is now read-only.

Segmentation fault with channel filter script #2166

Open
SoniEx2 opened this issue Apr 3, 2018 · 6 comments
Open

Segmentation fault with channel filter script #2166

SoniEx2 opened this issue Apr 3, 2018 · 6 comments

Comments

@SoniEx2
Copy link

SoniEx2 commented Apr 3, 2018

hexchat.register("Channel Filter", "1.0.0", "Filters channels")

local function on_open()
    print(hexchat.props["channel"], hexchat.props["network"])
    if hexchat.props["channel"] == "#hexchat" and hexchat.props["network"] == "freenode" then
        hexchat.command("close")
    end
end

hexchat.hook_print("Open Context", on_open)

Rather than keeping you from joining #hexchat, it just segfaults.

@TingPing
Copy link
Member

TingPing commented Apr 3, 2018

The solution would be for new_ircwindow() to detect that and return NULL and for all callers to handle that somehow.

@TingPing
Copy link
Member

TingPing commented Apr 3, 2018

A workaround would of course be hexchat.command("timer 1 close")

@SoniEx2
Copy link
Author

SoniEx2 commented Apr 3, 2018

Does timer save the context?

@SoniEx2
Copy link
Author

SoniEx2 commented Apr 3, 2018

Also, why not keep contexts alive until the main loop, and then clean up "closed" contexts while no plugins are running?

That way, it should also automatically fix #2161 #2160 #2167 and so on.

@TingPing
Copy link
Member

TingPing commented Apr 3, 2018

Does timer save the context?

Yes the timer will run in the same context.

Also, why not keep contexts alive until the main loop, and then clean up "closed" contexts while no plugins are running?

I'm not necessarily against it if you want to submit a patch.

@SoniEx2
Copy link
Author

SoniEx2 commented Apr 24, 2018

nvm keeping contexts alive - there's no "main loop".

SoniEx2 added a commit to SoniEx2/sonis-fork-of-hexchat that referenced this issue May 18, 2018
Also brings performance improvements (in theory).

Closes hexchat#2189
Closes hexchat#2166
Closes hexchat#2161
Closes hexchat#2160
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants