diff --git a/README.md b/README.md
index 61672708a..9f5733021 100755
--- a/README.md
+++ b/README.md
@@ -337,6 +337,7 @@ Remark:
## History
+* v2.0, 2017-05-01, Fix [#865][bug #865], shouldn't remove ts/m3u8 when hls_dispose disabled. 2.0.242
* v2.0, 2017-04-30, Fix [#636][bug #636], FD leak for requesting empty HTTP stream. 2.0.241
* v2.0, 2017-04-23, Fix [#851][bug #851], HTTP API support number of video frames for FPS. 2.0.240
* v2.0, 2017-04-18, [2.0 release1(2.0.239)][r2.0r1] released. 86515 lines.
@@ -1295,6 +1296,7 @@ Winlin
[bug #848]: https://github.com/ossrs/srs/issues/848
[bug #851]: https://github.com/ossrs/srs/issues/851
[bug #636]: https://github.com/ossrs/srs/issues/636
+[bug #865]: https://github.com/ossrs/srs/issues/865
[bug #xxxxxxxxxx]: https://github.com/ossrs/srs/issues/xxxxxxxxxx
[exo #828]: https://github.com/google/ExoPlayer/pull/828
diff --git a/trunk/src/app/srs_app_hls.cpp b/trunk/src/app/srs_app_hls.cpp
index 221f6a2fe..78fc5c2ba 100644
--- a/trunk/src/app/srs_app_hls.cpp
+++ b/trunk/src/app/srs_app_hls.cpp
@@ -1161,6 +1161,13 @@ void SrsHls::dispose()
on_unpublish();
}
+ // Ignore when hls_dispose disabled.
+ // @see https://github.com/ossrs/srs/issues/865
+ int hls_dispose = _srs_config->get_hls_dispose(_req->vhost);
+ if (!hls_dispose) {
+ return;
+ }
+
muxer->dispose();
}
diff --git a/trunk/src/core/srs_core.hpp b/trunk/src/core/srs_core.hpp
index 98c89c501..0c6fc2b92 100644
--- a/trunk/src/core/srs_core.hpp
+++ b/trunk/src/core/srs_core.hpp
@@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// current release version
#define VERSION_MAJOR 2
#define VERSION_MINOR 0
-#define VERSION_REVISION 241
+#define VERSION_REVISION 242
// generated by configure, only macros.
#include