# How to shut down or destroy the engine?

**URL:** https://discourse.kitware.com/t/how-to-shut-down-or-destroy-the-engine/508
**Category:** Pulse Physiology Engine
**Created:** [July 24, 2020, 6:21am UTC](https://discourse.kitware.com/t/how-to-shut-down-or-destroy-the-engine/508 "2020-07-24T06:21:47Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![lyh](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/l/b9e5f3/32.png) [@lyh](https://discourse.kitware.com/u/lyh)
#### Post date: [July 24, 2020, 6:21am UTC](https://discourse.kitware.com/t/how-to-shut-down-or-destroy-the-engine/508/1 "2020-07-24T06:21:47Z")

</div>

**How To Example**

Detected memory leaks!  
Dumping objects -\>  
{2803154} normal block at 0x000001BD70097280, 64 bytes long.  
Data: \< { p p \> 00 7B 09 70 BD 01 00 00 D0 D9 18 70 BD 01 00 00  
{2803153} normal block at 0x000001BD70ECBCB0, 32 bytes long.  
Data: \<google.protobuf.\> 67 6F 6F 67 6C 65 2E 70 72 6F 74 6F 62 75 66 2E  
{2803152} normal block at 0x000001BD70EF1B40, 16 bytes long.  
Data: \< r p \> 90 72 09 70 BD 01 00 00 00 00 00 00 00 00 00 00  
{2803150} normal block at 0x000001BD70096400, 64 bytes long.  
Data: \< p r p \> D0 D9 18 70 BD 01 00 00 00 72 09 70 BD 01 00 00  
{2803149} normal block at 0x000001BD70ECBB90, 32 bytes long.  
Data: \<google.protobuf.\> 67 6F 6F 67 6C 65 2E 70 72 6F 74 6F 62 75 66 2E  
{2803148} normal block at 0x000001BD70EF20E0, 16 bytes long.  
Data: \< d p \> 10 64 09 70 BD 01 00 00 00 00 00 00 00 00 00 00  
{2803146} normal block at 0x000001BD70097200, 64 bytes long.  
Data: \< d p ~ p \> 00 64 09 70 BD 01 00 00 00 7E 09 70 BD 01 00 00  
{2803145} normal block at 0x000001BD70ECBB30, 32 bytes long.  
Data: \<google.protobuf.\> 67 6F 6F 67 6C 65 2E 70 72 6F 74 6F 62 75 66 2E  
{2803144} normal block at 0x000001BD70EF1EB0, 16 bytes long.  
Data: \< r p \> 10 72 09 70 BD 01 00 00 00 00 00 00 00 00 00 00  
{2803142} normal block at 0x000001BD70097E00, 64 bytes long.  
Data: \< r p o p \> 00 72 09 70 BD 01 00 00 80 6F 09 70 BD 01 00 00  
{2803141} normal block at 0x000001BD70ECCF70, 32 bytes long.  
Data: \<google.protobuf.\> 67 6F 6F 67 6C 65 2E 70 72 6F 74 6F 62 75 66 2E  
{2803140} normal block at 0x000001BD70EF1DC0, 16 bytes long.  
Data: \< ~ p \> 10 7E 09 70 BD 01 00 00 00 00 00 00 00 00 00 00  
{2803138} normal block at 0x000001BD70096F80, 64 bytes long.  
Data: \< ~ p m p \> 00 7E 09 70 BD 01 00 00 80 6D 09 70 BD 01 00 00  
{2803137} normal block at 0x000001BD70ECCF10, 32 bytes long.  
Data: \<google.protobuf.\> 67 6F 6F 67 6C 65 2E 70 72 6F 74 6F 62 75 66 2E  
{2803136} normal block at 0x000001BD70EF2450, 16 bytes long.  
Data: \< o p \> 90 6F 09 70 BD 01 00 00 00 00 00 00 00 00 00 00  
…  
…  
…  
{238} normal block at 0x000001BD6DA3F610, 16 bytes long.  
Data: 70 31 A3 6D BD 01 00 00 00 00 00 00 00 00 00 00  
{237} normal block at 0x000001BD6DA33170, 32 bytes long.  
Data: \< m P m \> 10 F6 A3 6D BD 01 00 00 50 FE A3 6D BD 01 00 00  
{234} normal block at 0x000001BD6DA22340, 328 bytes long.  
Data: \<p1 m \< m \> 70 31 A3 6D BD 01 00 00 B0 3C A3 6D BD 01 00 00  
Object dump complete.

---

<div class="post-metadata">

### Author: ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)
#### Post date: [July 24, 2020, 12:52pm UTC](https://discourse.kitware.com/t/how-to-shut-down-or-destroy-the-engine/508/2 "2020-07-24T12:52:11Z")

</div>

The Engine is a self encapsulated C++ object wrapped in a unique\_ptr when [created](https://gitlab.kitware.com/physiology/engine/-/blob/master/src/cpp/howto/HowTo-EngineUse.cpp#L92)

Thus the engine will be automatically destroyed when that pointer goes out of scope or the program closes.

Those leak reports look to be coming from google.protobuf  
I would need specifics as to what exactly you are running to reproduce this  
Such as which HowToExample and if you modified any code

---

<div class="post-metadata">

### Author: ![lyh](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/l/b9e5f3/32.png) [@lyh](https://discourse.kitware.com/u/lyh)
#### Post date: [July 24, 2020, 11:51pm UTC](https://discourse.kitware.com/t/how-to-shut-down-or-destroy-the-engine/508/3 "2020-07-24T23:51:44Z")

</div>

I did not change the code of **HowTo-EngineUse.cpp**

I download 3.0 SDK here[这里](https://data.kitware.com/#collection/59849c788d777f7d33e9c084/folder/5c59a1018d777f072b2c79e6)

I created the mfc project and found a leak.

To the console project again, the same leak.

 ![1](https://discourse.kitware.com/uploads/default/original/1X/c641cdb676d2b7e5be116a39e78220973a2663cf.jpeg)

---

<div class="post-metadata">

### Author: ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)
#### Post date: [July 27, 2020, 12:11pm UTC](https://discourse.kitware.com/t/how-to-shut-down-or-destroy-the-engine/508/4 "2020-07-27T12:11:26Z")

</div>

I will have to look into the memory leaks and get back to you.  
If you happen to identify any location in Pulse that is producing the leak, let me know and I can probably patch it pretty quickly

Thanks for letting me know.

It sounds like you are working well with Pulse now!

---

<div class="post-metadata">

### Author: ![lyh](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/l/b9e5f3/32.png) [@lyh](https://discourse.kitware.com/u/lyh)
#### Post date: [July 28, 2020, 4:47am UTC](https://discourse.kitware.com/t/how-to-shut-down-or-destroy-the-engine/508/5 "2020-07-28T04:47:12Z")

</div>

Pulse is running well, thank you. 😀
