Skip to content

Commit 596ecdc

Browse files
committed
refactor: 优化销毁逻辑
1 parent 792568a commit 596ecdc

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

  • src/components/BootstrapBlazor.HikVision/wwwroot

src/components/BootstrapBlazor.HikVision/wwwroot/hikvision.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,19 +349,21 @@ export function stopRealPlay(id) {
349349

350350
export function dispose(id) {
351351
const vision = Data.get(id);
352-
Data.remove(id);
353-
354352
const { realPlaying, logined, observer } = vision;
355353
if (observer) {
356354
observer.disconnect();
357355
}
356+
WebVideoCtrl.I_HidPlugin();
357+
358358
if (realPlaying === true) {
359359
stopRealPlay(id);
360360
}
361361
if (logined === true) {
362362
logout(id);
363363
}
364364
WebVideoCtrl.I_DestroyPlugin();
365+
366+
Data.remove(id);
365367
}
366368

367369
const getTagNameFirstValue = (xmlDoc, tagName, defaultValue = '0') => {

0 commit comments

Comments
 (0)