diff --git a/source/blender/python/BPY_extern.h b/source/blender/python/BPY_extern.h
index 45a95b39a004d5d7b34b047ec47d2de3fe27fd78..48c5126c22bfbec6b021a61094319023de8f6912 100644
--- a/source/blender/python/BPY_extern.h
+++ b/source/blender/python/BPY_extern.h
@@ -61,6 +61,7 @@ extern "C" {
 /*void BPY_clear_bad_scriptlist(struct ListBase *, struct Text *byebye); */
 	int BPY_has_onload_script( void );
 	void BPY_do_all_scripts( short event );
+	int BPY_check_all_scriptlinks( struct Text *text );
 	void BPY_do_pyscript( struct ID *id, short event );
 	void BPY_free_scriptlink( struct ScriptLink *slink );
 	void BPY_copy_scriptlink( struct ScriptLink *scriptlink );
diff --git a/source/blender/python/BPY_interface.c b/source/blender/python/BPY_interface.c
index 1fd217656d91c9ae371585e7d97f6ccec235a1f4..bc691e002fbaea2a258823551403d0ca749f752e 100644
--- a/source/blender/python/BPY_interface.c
+++ b/source/blender/python/BPY_interface.c
@@ -1091,6 +1091,46 @@ void BPY_free_scriptlink( struct ScriptLink *slink )
 	return;
 }
 
+int CheckAllScriptsFromList( ListBase * list, Text * text )
+{
+	ID *id;
+	ScriptLink *scriptlink;
+	int index;
+	int fixed = 0;
+
+	id = list->first;
+
+	while( id != NULL ) {
+		scriptlink = ID_getScriptlink( id );
+		if( scriptlink && scriptlink->totscript ) {
+			for( index = 0; index < scriptlink->totscript; index++) {
+				if ((Text *)scriptlink->scripts[index] == text) {
+					scriptlink->scripts[index] = NULL;
+					fixed++;
+				}
+			}
+		}
+		id = id->next;
+	}
+
+	return fixed;
+}
+
+/* When a Text is deleted, we need to unlink it from eventual scriptlinks */
+int BPY_check_all_scriptlinks( Text * text )
+{
+	int fixed = 0;
+	fixed += CheckAllScriptsFromList( &( G.main->object ), text );
+	fixed += CheckAllScriptsFromList( &( G.main->lamp ), text );
+	fixed += CheckAllScriptsFromList( &( G.main->camera ), text );
+	fixed += CheckAllScriptsFromList( &( G.main->mat ), text );
+	fixed += CheckAllScriptsFromList( &( G.main->world ), text );
+	fixed += CheckAllScriptsFromList( &( G.main->scene ), text );
+
+	return fixed;
+}
+
+
 /*****************************************************************************
 * Description: 
 * Notes:
diff --git a/source/blender/python/api2_2x/NMesh.c b/source/blender/python/api2_2x/NMesh.c
index 7862330f4255dc8e315d21bc4865b23ba138e956..9b11d783af4e298eea4b44d90607e1aceaf1226d 100644
--- a/source/blender/python/api2_2x/NMesh.c
+++ b/source/blender/python/api2_2x/NMesh.c
@@ -2064,8 +2064,10 @@ static int unlink_existingMeshData( Mesh * mesh )
 	EXPP_unlink_mesh( mesh );
 	if( mesh->mvert )
 		MEM_freeN( mesh->mvert );
-	if( mesh->medge )
+	if( mesh->medge ) {
 		MEM_freeN( mesh->medge );
+		mesh->totedge = 0;
+	}
 	if( mesh->mface )
 		MEM_freeN( mesh->mface );
 	if( mesh->mcol )
diff --git a/source/blender/python/api2_2x/doc/API_intro.py b/source/blender/python/api2_2x/doc/API_intro.py
index bceef653dca04bb02f3197f65147980c2c8a23c2..b8506fd87e06d0853d7fbaab4fdaa9bc48dbc3b0 100644
--- a/source/blender/python/api2_2x/doc/API_intro.py
+++ b/source/blender/python/api2_2x/doc/API_intro.py
@@ -214,6 +214,75 @@ Blender Data Structures:
  Blender works the way it does, see the U{Blender Architecture document
  <http://www.blender3d.org/cms/Blender_Architecture.336.0.html>}.
 
+Documenting scripts:
+--------------------
+
+ The "Scripts Help Browser" script in the Help menu can parse special variables
+ from registered scripts and display help information for users.  For that,
+ authors only need to add proper information to their scripts, after the
+ registration header.
+
+ The expected variables:
+
+  - __bpydoc__ (or __doc__) (type: string):
+    - The main help text.  Write a first short paragraph explaining what the
+      script does, then add the rest of the help text, leaving a blank line
+      between each new paragraph.  To force line breaks you can use <br> tags.
+
+  - __author__ (type: string or list of strings):
+    - Author name(s).
+
+  - __version__ (type: string):
+    - Script version.
+
+  - __url__ (type: string or list of strings):
+    - Internet links that are shown as buttons in the help screen.  Clicking
+      them opens the user's default browser at the specified location.  The
+      expected format for each url entry is e.g.
+      "Author's site, http://www.somewhere.com".  The first part, before the
+      comma (','), is used as the button's tooltip.  There are two preset
+      options: "blender" and "elysiun", which link to the Python forums at
+      blender.org and elysiun.com, respectively.
+
+  - __email__ (optional, type: string or list of strings):
+    - Equivalent to __url__, but opens the user's default email client.  You
+      can write the email as someone:somewhere*com and the help script will
+      substitute accordingly: someone@somewhere.com.  This is only a minor help
+      to hide emails from spammers, since your script may be available at some
+      site.  "scripts" is the available preset, with the email address of the
+      mailing list devoted to scripting in Blender, bf-scripts-dev@blender.org.
+      You should only use this one if you are subscribed to the list:
+      http://projects.blender.org/mailman/listinfo/bf-scripts-dev for more
+      information.
+
+ Example::
+   __author__ = 'Mr. Author'
+   __version__ = '1.0 11/11/04'
+   __url__ = ["Author's site, http://somewhere.com",
+       "Support forum, http://somewhere.com/forum/", "blender", "elysiun"]
+   __email__ = ["Mr. Author, mrauthor:somewhere*com", "scripts"]
+   __bpydoc__ = \"\"\"\\
+   This script does this and that.
+
+   Explaining better, this script helps you create ...
+
+   You can write as many paragraphs as needed.
+
+   Shortcuts:<br>
+     Esc or Q: quit.<br>
+     etc.
+
+   Supported:<br>
+     Meshes, metaballs.
+
+   Known issues:<br>
+     This is just an example, there's no actual script.
+
+   Notes:<br>
+     You can check scripts bundled with Blender to see more examples of how to
+    add documentation to your own works.
+ \"\"\"
+
 A note to newbie script writers:
 --------------------------------
 
@@ -224,8 +293,8 @@ A note to newbie script writers:
  scripts to get an idea of what can be done, you may be surprised.
 
 @author: The Blender Python Team
-@requires: Blender 2.34 or newer.
-@version: 2.34cvs
+@requires: Blender 2.35 or newer.
+@version: 2.35
 @see: U{www.blender3d.org<http://www.blender3d.org>}: main site
 @see: U{www.blender.org<http://www.blender.org>}: documentation and forum
 @see: U{www.elysiun.com<http://www.elysiun.com>}: user forum
diff --git a/source/blender/python/api2_2x/doc/NMesh.py b/source/blender/python/api2_2x/doc/NMesh.py
index b98793e3798cc4ac478adf933d8f6d963f7bea43..ca2e42ccdbf13b0d04f0d441ef3457e505d3e35b 100644
--- a/source/blender/python/api2_2x/doc/NMesh.py
+++ b/source/blender/python/api2_2x/doc/NMesh.py
@@ -128,8 +128,13 @@ def GetRawFromObject(name):
   @param name: The name of an Object of type "Mesh".
   @rtype: NMesh
   @return: The NMesh wrapper of the mesh data from the Object called I{name}.
+  @note: For "subsurfed" meshes, it's the B{display} level of subdivision that
+      matters, the rendering one is only processed at the rendering pre-stage
+      and is not available for scripts.  This is not a problem at all, since
+      you can get and set the subdivision levels via scripting, too (see
+      L{NMesh.getSubDivLevels}, L{NMesh.setSubDivLevels}).
   @warn: This function gets I{deformed} mesh data, already modified for
-      rendering (think "display list").  It also doesn't let you overwrite the
+      displaying (think "display list").  It also doesn't let you overwrite the
       original mesh in Blender, so if you try to update it, a new mesh will
       be created.
   """
diff --git a/source/blender/src/drawtext.c b/source/blender/src/drawtext.c
index ef5656c7f1fbe34567f1c38c5a4c31118a31b003..e6e9ea598e19f9fc16c2f6c6bcd04962b74238a0 100644
--- a/source/blender/src/drawtext.c
+++ b/source/blender/src/drawtext.c
@@ -710,6 +710,13 @@ void unlink_text(Text *text)
 	ScrArea *area;
 	SpaceLink *sl;
 	
+	/* check if this text was used as script link:
+	 * this check function unsets the pointers and returns how many
+	 * script links used this Text */
+	if (BPY_check_all_scriptlinks (text)) {
+		allqueue(REDRAWBUTSSCRIPT, 0);
+	}
+
 	for (scr= G.main->screen.first; scr; scr= scr->id.next) {
 		for (area= scr->areabase.first; area; area= area->next) {
 			for (sl= area->spacedata.first; sl; sl= sl->next) {