Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
K
Koishi Thirdeye
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
3rdeye
Koishi Thirdeye
Commits
e3d70b42
Commit
e3d70b42
authored
Jun 16, 2022
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix obs dispose
parent
f885aaa6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
src/register.ts
src/register.ts
+12
-1
No files found.
src/register.ts
View file @
e3d70b42
...
...
@@ -31,6 +31,7 @@ export interface PluginMeta<T = any> {
__registrar
:
Registrar
;
__pluginOptions
:
KoishiPluginRegistrationOptions
<
T
>
;
__promisesToWaitFor
:
Promise
<
void
>
[];
__disposables
:
(()
=>
void
)[];
}
export
interface
OnApply
{
...
...
@@ -105,6 +106,7 @@ export function DefinePlugin<T>(
__pluginOptions
:
KoishiPluginRegistrationOptions
<
T
>
;
__registrar
:
Registrar
;
__promisesToWaitFor
:
Promise
<
void
>
[];
__disposables
:
(()
=>
void
)[];
_handleSystemInjections
()
{
const
injectKeys
=
reflector
.
getArray
(
KoishiSystemInjectSymKeys
,
this
);
...
...
@@ -170,7 +172,7 @@ export function DefinePlugin<T>(
methodKey
,
false
,
);
return
this
.
__registrar
const
sub
=
this
.
__registrar
.
runLayers
(
ctx
,
(
innerCtx
)
=>
...
...
@@ -178,6 +180,7 @@ export function DefinePlugin<T>(
methodKey
,
)
.
subscribe
();
this
.
__disposables
.
push
(()
=>
sub
.
unsubscribe
());
}
_registerDeclarationsWithStack
(
...
...
@@ -269,6 +272,13 @@ export function DefinePlugin<T>(
if
(
typeof
this
.
onDisconnect
===
'
function
'
)
{
await
this
.
onDisconnect
();
}
this
.
__disposables
.
forEach
((
dispose
)
=>
dispose
());
delete
this
.
__ctx
;
delete
this
.
__config
;
delete
this
.
__pluginOptions
;
delete
this
.
__registrar
;
delete
this
.
__promisesToWaitFor
;
delete
this
.
__disposables
;
});
}
...
...
@@ -318,6 +328,7 @@ export function DefinePlugin<T>(
this
.
__pluginOptions
=
options
;
this
.
__registrar
=
new
Registrar
(
this
,
undefined
,
config
);
this
.
__promisesToWaitFor
=
[];
this
.
__disposables
=
[];
this
.
_initializePluginClass
();
}
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment